anurada199 Posted April 22, 2011 Share Posted April 22, 2011 hey. im new to php and i get this error and i dnt know how to make it r8.here is my code and also i get undefined index for name/comment/submit but they all seems to work fine.plz help <?php require('contact.php'); $name=$_POST["name"]; $comment=$_POST["comment"]; $submit=$_POST["submit"]; if($submit){ if($name&&$comment){ $insQry=mysql_query("INSERT INTO `comment`.`comment` (`name`,`comment`) VALUES ('$name','$comment')"); }else{ echo "pleace Fill All the Fields"; } } ?> <?php $getqry=mysql_query("SELECT * FROM comment ORDER BY id DECS"); while($grows=mysql_fetch_array($getqry)){ $id=$grows['id']; $name=$grows['name']; $comment=$grows['comment']; echo $name . "<br />".$comment."<br />"."<hr />"; } ?> Link to comment https://forums.phpfreaks.com/topic/234411-warning-mysql_fetch_array-expects-parameter-1-to-be-resource-boolean-given-i/ Share on other sites More sharing options...
sunfighter Posted April 22, 2011 Share Posted April 22, 2011 ORDER BY id DESC You got the S and C reversed. Link to comment https://forums.phpfreaks.com/topic/234411-warning-mysql_fetch_array-expects-parameter-1-to-be-resource-boolean-given-i/#findComment-1204761 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.