I'm still having serious problems with retrieving records one at a time. This is actually the last partof the program.
Perhaps my code below won't work for that function. The code successfully retieves all records from the database. These are links to images. But for the life of me I can't seem to find a way to get php/sql to display one record at a time so that the user can move to the next record for viewing. I've looked at many samples, but most of them have some sort of link to a page to it. I do not have any links of this sort. The records in the database simply links to the image such as 'src='happy.gif', along with the path.
Is there a place that I could go to where I may find coding as such? Does anybody has a solution to this problem? Please let me know if you need more detail.
Any helpwould be greatful!
Thanks,
KJ
<?php
$db=mysql_connect("localhost","user",""
or die("Could not connect : " . mysql_error());
mysql_select_db("mylogin" or die("Could not select database"
$query = ("SELECT * FROM myimage "
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$num_rows = mysql_num_rows($result);
while ($row= mysql_fetch_array($result))
{
print "<table width=75% border=1>\n";
print "<td width=8%>";
echo '<img src=' .$row['imagefilepath']. '>';
print "</td>";
}
?>
Perhaps my code below won't work for that function. The code successfully retieves all records from the database. These are links to images. But for the life of me I can't seem to find a way to get php/sql to display one record at a time so that the user can move to the next record for viewing. I've looked at many samples, but most of them have some sort of link to a page to it. I do not have any links of this sort. The records in the database simply links to the image such as 'src='happy.gif', along with the path.
Is there a place that I could go to where I may find coding as such? Does anybody has a solution to this problem? Please let me know if you need more detail.
Any helpwould be greatful!
Thanks,
KJ
<?php
$db=mysql_connect("localhost","user",""
or die("Could not connect : " . mysql_error());
mysql_select_db("mylogin" or die("Could not select database"
$query = ("SELECT * FROM myimage "
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$num_rows = mysql_num_rows($result);
while ($row= mysql_fetch_array($result))
{
print "<table width=75% border=1>\n";
print "<td width=8%>";
echo '<img src=' .$row['imagefilepath']. '>';
print "</td>";
}
?>