I'm not certain if this is a bug or a stupid error on my part, but I'd like to display a list of plays and theatrical performances from a database.
I can get it to display from row/entry 2 downwards fine - but it won't display the first row at all. Where there is only one entry, nothing is displayed. I've tried altering the id's of each, but it seems to just be the first one entered that isn't picked up, but ones entered after are.
The code to display the table is below.
<?php
$con = mysql_connect("localhost"," me "," mypass word");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db(" database name", $con);
$data = mysql_query("SELECT * FROM table")
or die(mysql_error());
$info = mysql_fetch_array( $data );
while($info = mysql_fetch_array( $data ))
{
Print "<tr><td style='background-color: #D3D3D3; '>";
Print " ".$info['title'] . " ";
Print "</td>";
...etc...
Print "</td> </tr>";
}
?>
</table>
It seems quite simple but I can't figure it out at all. Any help much appreciated.