Here are the contents of pictures.php:
<?php
include "db_connect.php";
$sql = 'SELECT * FROM `Member` LIMIT 0, 30 ';
$result = mysql_query($sql);
while ($row=mysql_fetch_array($result))
{
$username=$row["loginName"];
}
$result2=mysql_query("SELECT Image FROM Member WHERE loginName=$username") or die("Can't perform Query");
$row=mysql_fetch_object($result2);
Header( "Content-type: image/jpg");
echo $row->Image;
?>
Here's my database structure so far:
loginName createDate password firstName lastName email Image
Only, there are mutliple rows I want to select and print. For example, I have two rows with the same loginName as "John." One contains all of the password, firstName, ect., the other rows just have loginName as John and the Image filled in. I want to select all rows with "John", and print the images stored with Image from those rows.