Home Answers Viewqa PHP how to retrive the particular data from database in php with mysql?

 
 


Johnson
how to retrive the particular data from database in php with mysql?
1 Answer(s)      a year and 8 months ago
Posted in : PHP

when am using mysqlfetcharray() that display the following error. the code look like this..

<?php


$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("samp", $con);
$Name=$_POST['unames'];
$data=mysql_query("SELECT * FROM tbl_sample where Name='$Name'");

/*$info=mysql_fetch_array($data);*/
while($info=mysql_fetch_array($data))
{
echo"<b>NAME</b>:".$info['Name']."<br><b>KEYSKILLS</b>:".$info['Keyskills']."<br><b>EXPERIENCE</b>:".$info['Experience']."<br><b>CURRENT ADDRESS</b>".$info['CurrentAddress']."<br><b>PERMANANT ADDRESS</b>".$info['PermanantAddress']."<br><b>COMPANY ADDRESS</b>".$info['CompanyAddress']."<br><b>MOBILE NO</b>".$info['MobileNo']."<br><b>QUALIFICATION</b>".$info['Qualification']."<br><b>CURRENT LOCATION</b>".$info['CurrentLocation']."<br><b>STATE</b>".$info['State']."<br><b>NATIONALITY</b>".$info['Nationality']."<br><b>DATE OF BIRTH</b>".$info['DOB'];
}
mysql_close($con);
?>

this shows the error like this....

Warning: mysqlfetcharray(): supplied argument is not a valid MySQL result resource in C:\wamp\www\sample\related.php on line 15

plz give suggestion..

Thanks in advance

View Answers









Related Pages:

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.