big-dog1965
05-24-2009, 05:41 AM
I’ve been struggling for days here and I think the problem is my form process page and the page to display the data from my table. Here is a snippet of code from the process page.
$query = "INSERT into `".$db_table."` (venue,address,date_1,time_1,date_2,time_2,date_3,time_3,date_4,time_4,host,host_email,venue_website ,venue_phone,logo_image) VALUES ('" . $_POST['venue'] . "','" . $_POST['address'] . "','" . $_POST['date_1'] . "','" . $_POST['time_1'] . "','" . $_POST['date_2'] . "','" . $_POST['time_2'] . "','" . $_POST['date_3'] . "','" . $_POST['time_3'] . "','" . $_POST['date_4'] . "','" . $_POST['time_4'] . "','" . $_POST['host'] . "','" . $_POST['host_email'] . "','" . $_POST['venue_website'] . "','" . $_POST['venue_phone'] . "','" . $_FILES['logo_image'] . "')";
mysql_query($query);
Here is a snippet from the page to display data. I’m trying to get the image to appear on page with the corresponding venue, address, date1, and so on.
$query= 'SELECT venue, address, date_1, time_1, date_2, time_2, date_3, time_3, date_4, time_4, host, host_email, venue_website, venue_phone, logo_image FROM Venues ORDER BY date_1 ASC LIMIT 0, 100';
$result = mysql_query($query) or die(mysql_error());
while ($row = @mysql_fetch_array ($logo_image) )
{
$logo_image = $row["logo_image"]; //picname is the name of the field in the images table
}
if(empty($row['logo_image']) && true) //debug
{
echo "<img src='admin/venues/files/noimage.gif'>"; // no image
}else{
echo "<img src='admin/venues/files/{$row['logo_image']}'>"; // found image
if (!empty($row['venue'])) echo "<b>".$row['venue']."</b><br />\n";
if (!empty($row['address'])) echo $row['address']."<br />\n";
if (!empty($row['date_1'])) echo $row['date_1']." ";
if (!empty($row['time_1'])) echo $row['time_1']."<br />\n";
if (!empty($row['date_2'])) echo $row['date_2']." ";
if (!empty($row['time_2'])) echo $row['time_2']."<br />\n";
if (!empty($row['date_3'])) echo $row['date_3']." ";
if (!empty($row['time_3'])) echo $row['time_3']."<br />\n";
if (!empty($row['date_4'])) echo $row['date_4']." ";
if (!empty($row['time_4'])) echo $row['time_4']."<br />\n";
if (!empty($row['host'])) echo "Host: ".$row['host']." ";
if (!empty($row['host_email'])) echo "Host Email: ".$row['host_email']."<br />\n";
if (!empty($row['venue_website'])) echo $row['venue_website']."<br />\n";
if (!empty($row['venue_phone'])) echo $row['venue_phone']."<br />\n";
echo "<hr>";
}
Unfortunately with this now nothing displays except the noimage.gif that is only supposed to be there if no logo image was uploaded
$query = "INSERT into `".$db_table."` (venue,address,date_1,time_1,date_2,time_2,date_3,time_3,date_4,time_4,host,host_email,venue_website ,venue_phone,logo_image) VALUES ('" . $_POST['venue'] . "','" . $_POST['address'] . "','" . $_POST['date_1'] . "','" . $_POST['time_1'] . "','" . $_POST['date_2'] . "','" . $_POST['time_2'] . "','" . $_POST['date_3'] . "','" . $_POST['time_3'] . "','" . $_POST['date_4'] . "','" . $_POST['time_4'] . "','" . $_POST['host'] . "','" . $_POST['host_email'] . "','" . $_POST['venue_website'] . "','" . $_POST['venue_phone'] . "','" . $_FILES['logo_image'] . "')";
mysql_query($query);
Here is a snippet from the page to display data. I’m trying to get the image to appear on page with the corresponding venue, address, date1, and so on.
$query= 'SELECT venue, address, date_1, time_1, date_2, time_2, date_3, time_3, date_4, time_4, host, host_email, venue_website, venue_phone, logo_image FROM Venues ORDER BY date_1 ASC LIMIT 0, 100';
$result = mysql_query($query) or die(mysql_error());
while ($row = @mysql_fetch_array ($logo_image) )
{
$logo_image = $row["logo_image"]; //picname is the name of the field in the images table
}
if(empty($row['logo_image']) && true) //debug
{
echo "<img src='admin/venues/files/noimage.gif'>"; // no image
}else{
echo "<img src='admin/venues/files/{$row['logo_image']}'>"; // found image
if (!empty($row['venue'])) echo "<b>".$row['venue']."</b><br />\n";
if (!empty($row['address'])) echo $row['address']."<br />\n";
if (!empty($row['date_1'])) echo $row['date_1']." ";
if (!empty($row['time_1'])) echo $row['time_1']."<br />\n";
if (!empty($row['date_2'])) echo $row['date_2']." ";
if (!empty($row['time_2'])) echo $row['time_2']."<br />\n";
if (!empty($row['date_3'])) echo $row['date_3']." ";
if (!empty($row['time_3'])) echo $row['time_3']."<br />\n";
if (!empty($row['date_4'])) echo $row['date_4']." ";
if (!empty($row['time_4'])) echo $row['time_4']."<br />\n";
if (!empty($row['host'])) echo "Host: ".$row['host']." ";
if (!empty($row['host_email'])) echo "Host Email: ".$row['host_email']."<br />\n";
if (!empty($row['venue_website'])) echo $row['venue_website']."<br />\n";
if (!empty($row['venue_phone'])) echo $row['venue_phone']."<br />\n";
echo "<hr>";
}
Unfortunately with this now nothing displays except the noimage.gif that is only supposed to be there if no logo image was uploaded