Okay, this is where I am at. I have a photodisplay.php that I use to call images ?id=etc. My display code is this:
<?php $username = "y"; $password = ""; $host = "localhost"; $database = "yakimaimplement"; mysql_connect($host, $username, $password) or die("Can not connect to database: ".mysql_error()); mysql_select_db($database) or die("Can not select the database: ".mysql_error()); $data = mysql_query("SELECT * FROM used_equip") or die(mysql_error()); //Outputs the image and other data //Need to add a LOOP of some sort, to tile entries down page. while($info = mysql_fetch_array( $data )) { Print "<table>"; Print "<tr valign=\"top\">"; Print "<td rowspan=\"3\">"; Print "<img src=\"".$info['photo'] . \">"; Print "</td>"; Print "<td style=\"padding-left: 20px;\">"; Print "<b>Model:</b> ".$info['model'] . "<br> "; Print "<b>Serial:</b> ".$info['serial'] . "<br> "; Print "<b>Application:</b> ".$info['application'] . "<br> "; Print "<br />"; Print "</p>"; Print "</td>"; Print "</tr>"; Print "</table>"; } ?>
I did something, which probably could have been accomplished easier some other way, but I have a field in the images table that matches a field in the used_equip table, so that (I assume)when I display each item, it matches with the correct image.
In my head, I keep wanting to do something like "SELECT * FROM used_equip,images WHERE serial LIKE usedid".
And then, in my array_fetch, it will ensure that they are matched. However, that makes no sense whatsoever. I think I'm approaching it wrong.
I don't know much about the JOIN function, is that what I want?
Would I do a SELECT usedid FROM images and then have a loop that matches the two fields, then processes the photo with each while loop that way?
Endless frustration.