do you mean "list the photo id and picture [caption? name?]..."
PHP Code:
// The basic SELECT statement
$select = " SELECT photo_category, photo_id, photo_filename, photo2_id, photo_caption, photo_price "; parents.NAME, parents.EMAIL, parents.PHONE, parents.ACTIVE, parents.REMINDER";
$from = " FROM gallery_photos";
$order = " ORDER by photo_id desc ";
?>
<br />
<table width="100%"border="1">
<tr>
<th><font face="Arial, Helvetica, sans-serif">Category</font></th>
<th><font face="Arial, Helvetica, sans-serif">Photo ID</font></th>
<th><font face="Arial, Helvetica, sans-serif">Trans File Name</font></th>
<th><font face="Arial, Helvetica, sans-serif">Trans Caption</font></th>
<th><font face="Arial, Helvetica, sans-serif">Trans Thumb</font></th>
<th><font face="Arial, Helvetica, sans-serif">Price</font></th>
<th><font face="Arial, Helvetica, sans-serif">In Use Photo ID</font></th>
<th><font face="Arial, Helvetica, sans-serif">In Use File Name</font></th>
<th><font face="Arial, Helvetica, sans-serif">In Use Caption</font></th>
<th><font face="Arial, Helvetica, sans-serif">In Use Thumb</font></th>
<th><font face="Arial, Helvetica, sans-serif">Options</font></th>
</tr>
<?php
$result = mysql_query($select . $from . $where . $order);
if (!$result) {
echo("</table>");
echo("<p>Error retrieving data from database!<br />".
"Error: " . mysql_error() . "</p>");
exit();
}
//while loop, will run through all rows that
//have been fetched
while($row=mysql_fetch_array($result)) {
//put $row stuff into workable variables
$category = $row["photo_category"];
$photo_id = $row["photo_id"];
$photo_filename = $row["photo_filename"];
$photo_caption = $row["photo_caption"];
//Thransparency Thumbnail
$photo_price = $row["photo_price"];
//in-use stuff
$photo2_id = $row["photo2_id"];
//In-Use Thumbnail
/*******************************************************
* *
* *
* sitepoint thread: ignore this part, i combined two galleries for this user *
* *
* *
*******************************************************/
//get photo2 data
$result2 = mysql_query(" SELECT photo_id2, photo_filename2, photo_caption2 FROM gallery_photos2 WHERE photo_id2=$photo2_id ");
if (!$result2) {
echo("</table>");
echo("<p>Error retrieving data from database!<br />".
"Error: " . mysql_error() . "</p>");
exit();
}
$row2 = mysql_fetch_array($result2);
$photo_id2 = $row2["photo_id2"];
$photo_filename2 = $row2["photo_filename2"];
$photo_caption2 = $row2["photo_caption2"];
if (!$photo_caption2) {
$photo_caption2 = "<i>empty</i>";
}
$result3 = mysql_query(" SELECT * from gallery_category WHERE category_id= $category ");
$row3 = mysql_fetch_array($result3);
$category = $row3["category_name"];
/*******************************************************
* *
* *
* sitepoint thread: end - "ignore this...", *
* *
* *
*******************************************************/
//echo the options out...
echo("
<tr>
<td align=\"center\">$category</td>\n
<td align=\"center\">$photo_id</td>\n
<td align=\"center\">$photo_filename</td>\n
<td align=\"center\">$photo_caption</td>\n
<td align=\"center\"><img src=\"/manage/photos/tb_$photo_id.jpg\"></td>\n
<td align=\"center\">$ $photo_price</td>\n
<td align=\"center\">$photo_id2</td>\n
<td align=\"center\">$photo_filename2</td>\n
<td align=\"center\">$photo_caption2</td>\n
<td align=\"center\"><img src=\"/manage/photos/tb_$photo_filename2\"></td>
<td align=\"center\">[<a href='edititem.php?id=$photo_id'>Edit</a> .
<a href=\"delitem.php?id=$photo_id\" onClick=\"return confirm('Are you sure you want to delete this parent account with id# $photo_id ??')\">Delete</a>]</td>\n
</tr>");
//loop
}
ends up looking like the attachment...
Bookmarks