Hi, can anyone help please!
I have a problem running this php script. Once I run the script I get the following error message:
Warning: 0 is not a MySQL result index in /users/eee/pmdise8/mann/.public_html/cgi-bin/book4.php3 on line 19
what I am doing wrong!!?
<body>
<CENTER>
<h2>A DATABASE OF PUBLICATIONS </H2>
</CENTER>
<p>
<table border="1" width="100%">
<tr>
<td width="10%" align="center"><big><strong>item id </strong></big></td>
<td width="30%" align="center"><big><strong>title</strong></big></td>
<td width="30%" align="center"><big><strong>publisher</strong></big></td>
<td width="30%" align="center"><big><strong>price </strong></big></td> </tr>
</table>
<?php
$ mysql_link = mysql_connect (""," mann ","");
$ testresult = mysql_select_db (" mann",$ mysql_link);
$query="select * from book";
$ mysql_result = mysql_query ($query,$mysql_link);
if ( mysql_num_rows ($mysql_result)>0){
print "<table border=\"1\" width=\"100%\">";
while ($row= mysql_fetch_row ($mysql_result)){
print "<td width=\"10%\">$row[0]</td>";
print "<td width=\"30%\">$row[1]</td>";
print "<td width=\"30%\">$row[2]</td>";
print "<td width=\"30%\">$row[3]</td>";
print "</tr>";
}
print "</table>";
}
?>
</body>