my sql output
here my mysql data output not display tell where i write wrong thing

here my table name=data


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>

<
html xmlns="http://www.w3.org/1999/xhtml">

<
head>
  <
title>Hello!</title>
</
head>

<
body>

<?php
$con
=mysql_connect('localhost','michele','secret');
{
if(!
$con)
die(
'could not connect:' or mysql_error());
}
echo
"  connect sucessfully";
//mysql_close($con);
mysql_select_db($data$con)
 or die(
"Selecting MySQL database ");

//mysql_close($con);
          
$query1='use store';
$rt=mysql_query($query1);

if(
$rt){echo " Command is successful ";}
else
{echo 
"Command is not successful ";}

$query="select * from data";  // query string stored in a variable
$rt=mysql_query($query);          // query executed
echo mysql_error();

while(
$nt=mysql_fetch_array($rt)){
echo 
$nt[id] $nt[name] $nt[cty] $nt[college] $nt[branch] $nt[marks]     <br>";
 }

?>

</body>

</
html


1st Apr 2011 at 7:05 AM   1298 Views

What kind of error u r getting from server... ?
1st Apr 2011 at 8:33 AM  

ok use this "echo" in u'r last line inplace of ur's & tell me what is the result u r getting.

echo '<br> ID : '.$nt[id];
echo 
'<br> Name : '.$nt[name]; 
1st Apr 2011 at 8:49 AM  

Hey!!!, here is a nice example which i think will help u lot..
Link: http://www.tizag.com/mysqlTutorial/mysqlselect.php
1st Apr 2011 at 8:51 AM  

The tizag link has really a nice script. Go with that madhu... :)
1st Apr 2011 at 11:46 PM