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 />"; } ?> Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.