Jump to content

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given i


anurada199

Recommended Posts

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 />";

 

}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.