I've been trying to figure out this code recently but have been running into trouble.
I'm creating a directory of people for work. On it, you can search for their information which sits on the mySQL database. That works fine, but I want to have the entries respective image come up as well. (i.e. If employee 1 comes up, 1.jpg comes up with it)
I am trying to use the employeeID field, which is the primary key, auto increment field. So values in it are 1, 2, 3, 4, etc. And I've named my jpegs which are in a directory on my server the same 1.jpg ,2.jpg, 3.jpg, 4.jpg, etc.
This code I wrote to display the images is:
echo "<p><img src=\"http://www.URLname.com/folder/employees/images/" . $result3 . ".jpg\">";
And my variable $result3 which is:
$query3 = "select EmployeeID from providers";
$result3 = mysql_query($query3);
Doesn't work. Any suggestions?
B