thumbnails on a webpage
Posted: Tue Apr 07, 2009 5:13 pm
Hello,
I'm developing a web page that is a php query result from a form that my users submit. It's pretty much a contact list. I have it set up so that users fill out a form with some contact info, background info, comments, and a photo. After they submit their info, they can click on the contact list page to see the list of people who signed up so far. This just has some basic info and then a link for another page for extended information about the person that the user selected. What I'm looking for is on the first page with the basic info, I want to show a thumbnail sized photo of each person from the photo they submitted and is stored in the database. Right now, the actual photo submitted is the one that shows up. I'm very new to all this and have had some help building it thus far, hence the reason I'm here now.
Here's my code for the first page:
Vince
I'm developing a web page that is a php query result from a form that my users submit. It's pretty much a contact list. I have it set up so that users fill out a form with some contact info, background info, comments, and a photo. After they submit their info, they can click on the contact list page to see the list of people who signed up so far. This just has some basic info and then a link for another page for extended information about the person that the user selected. What I'm looking for is on the first page with the basic info, I want to show a thumbnail sized photo of each person from the photo they submitted and is stored in the database. Right now, the actual photo submitted is the one that shows up. I'm very new to all this and have had some help building it thus far, hence the reason I'm here now.
Here's my code for the first page:
Thanks in advance for your help.<?php
// Make a MySQL Connection and pick the example database "contactsdb"
mysql_connect("localhost", "user", "password") or die(mysql_error());
mysql_select_db("my_database") or die(mysql_error());
// Get the data from your table, in this example..the "contacts" table..since you want certain data..we'll use example columns "name" and "phone"
$result = mysql_query("SELECT hdw_id, Name, Address, City, State, Zip, Phone1, email, Background, Photo FROM members ORDER BY Name ")
or die(mysql_error());
echo "<table border='0' cellpadding='0' cellspacing='0' align='left' width='100%' class='clist_table'>";
echo "<tr> <th class='clist_table_hdg'>Name</th> <th class='clist_table_hdg'>Address</th> <th class='clist_table_hdg'>Phone</th> <th class='clist_table_hdg'>Email</th> <th class='clist_table_hdg'>Background</th> <th class='clist_table_hdg'>MoreInfo</th> <th class='clist_table_hdg'>Photo</th> </tr>";
//get the data from the rows
while($row = mysql_fetch_array( $result )) {
$id = $row['hdw_id'];
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['Name'];
echo "</td><td nowrap='nowrap'>";
echo $row['Address'];
echo "<br />";
echo $row['City'];
echo "<br />";
echo $row['State'];
echo ", ";
echo $row['Zip'];
echo "</td><td>";
echo $row['Phone1'];
echo "</td><td><a href='mailto: ";
echo $row['email'];
echo "'>Email";
echo "</a></td><td>";
echo $row['Background'];
echo "</td><td><a href='community_contact_list_extended.php?id=$id'>MoreInfo</a></td><td>";
echo "<img src='";
echo $row['Photo'];
echo "'></td><tr>";
}
echo "</table>";
?>
Vince