hey all
the following code kinda works but doesn't!!!
It displays the first and last names of a photographer underneath the photos.
It currently just displays the first row of the table "photographers" but i need it to display the entry with the corresponding field.
i.e. i need to get the value of the column "photog" from the table "snipe_gallery_cat"
and then pull the row of infomation from the table "photographers" where the column is called "phg_id".
When the value of photog is the same as phg_id then i need it to display the rest if the row in photographers.
The photos have been called up using a variable "$cat_id" which is a column in a third table called "snipe_gallery_data"
The column $cat_id has numbers that are the same as a column $id in the "snipe_gallery_cat" table to show which folders belong with which category.
I hope this all makes sense and that someone understands my gibberish and can help!!
I have been working on this for the past 5 hours and i swear i have tried everything possible!!
PLEASE help me before all my hair has gone!!!
thanks
Matt
here is the code i have so far:
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("toast",$db);
$result = mysql_query("SELECT phg_firstname,phg_lastname FROM photographers");
$myrow = mysql_fetch_array($result);
printf("First Name: %s\n<br>", $myrow["phg_firstname"]);
printf("Last Name: %s\n<br>", $myrow["phg_lastname"]);
?>