Ok, I have stored the images path in mysql and am pulling them form a directory on my server. After I ask for all the data and link the images they show up fine in IE. But I am trying to spit them out in my website one at a time. So the user can click on back and select another image. I think that my logic is jst off. Any help!!!.
index.php code:
<?php
$connection = mysql_connect ("localhost", "", "");
if ($connection == false){
echo mysql_errno().": ".mysql_error()."<BR>";
exit;
} //end if
$query = "select * from test";
$result = mysql_db_query ("asi_auth_db", $query);
if ($result){
echo "<table width=415 border=0 cellspacing=0 cellpadding=2 align=center>";
echo "<tr>
<td align=center><strong><u>Log File#</u></strong></td>
<td align=center><strong><u>District</u></strong></td>
<td align=center><strong><u>Tract Name</u></strong></td>
<td align=center><strong><u>Stand</u></strong></td>
<td align=center><strong><u>Acres</u></strong></td>
</tr>";
$numOfRows = mysql_num_rows ($result);
for ($i = 0; $i < $numOfRows; $i++){
$row_class = ($i % 2) ? 'Data1' : 'Data2';
$map_php = mysql_result ($result, $i, "map_php");
$logfile = mysql_result ($result, $i, "log_file");
$district = mysql_result ($result, $i, "district");
$tractname = mysql_result ($result, $i, "tract_name");
$stand = mysql_result ($result, $i, "stand");
$acres = mysql_result ($result, $i, "acres");
echo "<tr class=\"$row_class\">
<td><a href=$map_php class=image>$logfile</a></td>
<td>$district</td>
<td>$tractname</td>
<td>$stand</td>
<td>$acres</td>
</tr>";
$row_count ++;
} //end for
mysql_free_result($result);
echo "</table>";
} else {
echo mysql_errno().": ".mysql_error()."<BR>";
} //end if
mysql_close($connection);
?>
map.php code:
<?php
$connection = mysql_connect ("localhost", "", "");
if ($connection == false){
echo mysql_errno().": ".mysql_error()."<BR>";
exit;
} //end if
$query = "select * from test";
$result = mysql_db_query ("asi_auth_db", $query);
$name = mysql_result ($result, $i, "name");
$image = mysql_result ($result, $i, "image");
echo "<table width=450 border=0 cellspacing=0 cellpadding=2 align=center>";
echo "<tr><td align=left><strong><u>Map# $name</u></strong> | <a href=index.php>Back to Log Files</a></td></tr>";
echo "<tr><td><img src=$image border=1></td></tr>";
mysql_free_result($result);
echo "</table>";
mysql_close($connection);
?>
It call the first one just fine, but can't figure out how to get it to call the others. I can with out it being in the website just fine, but not as nice!
Thanks for any help!
Chris