dbqclassof2012
New Member
- Messages
- 15
- Reaction score
- 0
- Points
- 0
Hello I am currently working on making a comment box for my website and have had a lot of progress but this end part i have not been able to get. I have the form and everything done it submits it to the database fine but then bringing the comments back to the page it always comes up with this error
I have not been able to fix this and if anyone could help me it would be greatly appreciated!!!!!Heres the code i am working with
IF YOU PROVIED ME WITH MY ANSWER I WILL REWARD YOU WITH OVER 200 CREDITS!
Code:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/dbqclass/public_html/getcomments.php on line 22
PHP:
<?php
// Open Connection To mySQL.
// Replace 'username' and 'password' with appropiate login values for your server.
$mysqlLink = mysql_connect( 'localhost' , 'username' , 'pass' );
// Select mySQL Database.
mysql_select_db( 'comments' , $mysqlLink );
// Create Query To Create Table.
$sql = 'SELECT `name`, `comment_date`, `comment` FROM `comments`';
// Issue Query.
$result = mysql_query( $sql );
// Loop through results and print them.
while( $row = mysql_fetch_array( $result ) ) {
echo $row[ 'name' ] . $row[ 'comment_date' ] . $row[ 'comment' ];
}
// Close mySQL Connection.
mysql_close( $mysqlLink );
?>
IF YOU PROVIED ME WITH MY ANSWER I WILL REWARD YOU WITH OVER 200 CREDITS!
Last edited: