if (!@mysql_select_db("mtlc?old")) {
echo 'Unable to locate the ' . 'database.';
}
if(isset($_POST['commenttext'])) {
$commenttext = $_POST['commenttext'];
$name = $_POST['name'];
$email = $_POST['email'];
$sql = "INSERT INTO comments SET
commenttext ='$commenttext',
commentdate =NOW(),
name ='$name',
email='$email'";
if (!@mysql_query($sql)) {
echo 'Error adding query: ' . mysql_error();
}
}
echo 'The comments listed in the database...
';
$result = @mysql_query('SELECT commenttext, commentdate, name, email FROM comments');
if (!$result) {
echo 'Error performing query: ' . mysql_error();
}
?>
' . $row['commentdate'] . '
' . $row['commenttext'] . '
'; echo 'Add comment!'; ?> $names = array("hello","hello","hello","hello","hello","hello","hello","hello","hello","hello","hello","hello","hello","hello",); $page = $_GET['page']; $pagedResults = new Paginated($names, 10, $page); echo "
"; while($row = $pagedResults->fetchPagedRow()) { echo "- {$row}
";
}
echo "
"; $pagedResults->setLayout(new DoubleBarLayout()); echo $pagedResults->fetchPagedNavigation(); ?> $names = array("hello","etc..."); Instead of a list of works inside the array I want to display the comments info inside the database, but it identifies it as 'id', and retrieves the # of comments inside of the DB and creates the pages accordingly. Everything is functional, but combining them is the problem, I just can't figure it out. Now: Comment List ---------------------------- Comment 1 -------------------------- ---------------------------- Comment 2 -------------------------- Array List penis penis penis penis penis etc... 1 | 2 | 3 After: ---------------------------- Comment 1 -------------------------- ---------------------------- Comment 2 -------------------------- etc... 1 | 2 | 3