Jump to content

Image Not Loading


Xtremer360

Recommended Posts

I have an image that isn't loading and I was hoping someone could tell me why?

 

http://kansasoutlawwrestling.com/upcomingshow2.php

 

<?php echo "<body bgcolor=\"black\" text=\"white\" link=\"red\" vlink=\"red\">"; 

require ('database.php');


print '<center><img src=/images/'.$row['showimage'].' height=125 width=500 border=1></center>';

//Define the query
$query = "SELECT *, DATE_FORMAT(`date`, '%M %e, %Y') AS date FROM shows, matches WHERE matches.showid = shows.id ORDER BY matchid ASC";

if (($r = mysql_query ($query)) && mysql_num_rows ($r)){  

// First row (for the date, location, and time)
$row = mysql_fetch_array ($r);
print '<center>Show Name: '.$row['showname'].'</center>';
print '<center>Date: '.$row['date'].'</center>';
print '<center>Location: '.$row['location'].'</center>';
print '<center>Bell Time: '.$row['belltime'].'</center><br><br>';

// Retrieve and print every record
do {
print '<center>'.$row['matchtype'].' Match</center>';
print '<center>'.$row['vs1'].' vs. '.$row['vs2'].'</center><br>';
} while ($row = mysql_fetch_array ($r));
}  


?> 

Link to comment
https://forums.phpfreaks.com/topic/125239-image-not-loading/
Share on other sites

What is in database.php? What is the image supposed to be?

 

If it doesn't need to be changed, then replace:

print '<center><img src=/images/'.$row['showimage'].' height=125 width=500 border=1></center>';

with

print '<center><img src=/images/imagename.jpg height=125 width=500 border=1></center>';

 

Also, <center> tags shouldn't be used anymore, and you should really add quotes around your image source.

Link to comment
https://forums.phpfreaks.com/topic/125239-image-not-loading/#findComment-647414
Share on other sites

OK, you are not defining "$row['showimage']." You are using that as the variable that holds which image you want to use, but you are not telling the code what that variable should be. Judging by the fact that it is a "$row" variable, I'm guessing that you intended on grabbing the info from a database table, but you aren't selecting any data.

 

To fix this, it's easy: DEFINE $row['showimage']

Link to comment
https://forums.phpfreaks.com/topic/125239-image-not-loading/#findComment-647418
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.