Connecting Tech Pros Worldwide Help | Site Map

fetching record then result is query was empty

Newbie
 
Join Date: Jun 2007
Posts: 1
#1: Jun 13 '07
hi,

i have fetching record from mysql database in this formate

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $connsqlhostname = "localhost";
  3. $connbase = "rajgorsamaj";
  4. $connlogin = "pushpa";
  5. $connpassword = "123456";
  6. $db_connect = mysql_connect($connsqlhostname,$connlogin,$connpassword) or die ("<B>Error ".mysql_errno()." :</B> ".mysql_error()."");
  7.  
  8. $query="select id,surname from dataentry";
  9. $rs=mysql_query($qyery) or die(mysql_error());
  10. while($dataentry=mysql_fetch_array($rs))
  11. {  
  12.     $i++;
  13.     echo "<tr>";
  14.     echo "<td align=center><h1><center>".$i."</center></h1></td>";
  15.     echo "<td align=center><h1><center>".$dataentry[0]."</center></h1></td>";
  16.     echo "<td align=center><h1><center>".$dataentry[1]."</center></h1></td>";
  17. }
  18. ?> 
  19.  
so why result page is display query was empty

please reply me
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#2: Jun 13 '07

re: fetching record then result is query was empty


Quote:

Originally Posted by pushpa4385

hi,

i have fetching record from mysql database in this formate


<?php
$connsqlhostname = "localhost";
$connbase = "rajgorsamaj";
$connlogin = "pushpa";
$connpassword = "123456";
$db_connect = mysql_connect($connsqlhostname,$connlogin,$connpas sword) or die ("<B>Error ".mysql_errno()." :</B> ".mysql_error()."");

$query="select id,surname from dataentry";
$rs=mysql_query($qyery) or die(mysql_error());
while($dataentry=mysql_fetch_array($rs))
{
$i++;
echo "<tr>";
echo "<td align=center><h1><center>".$i."</center></h1></td>";
echo "<td align=center><h1><center>".$dataentry[0]."</center></h1></td>";
echo "<td align=center><h1><center>".$dataentry[1]."</center></h1></td>";
}


?>





so why result page is display query was empty



please reply me

Are there any values in the table?
Motoma's Avatar
Moderator
 
Join Date: Jan 2007
Location: Maine, USA
Posts: 2,904
#3: Jun 13 '07

re: fetching record then result is query was empty


Take a look at these instructions about enabling runtime error messages on pages. Post back once you have an error message to give us.
Reply


Similar MySQL Database bytes