cturner Posted February 4, 2007 Share Posted February 4, 2007 I am trying to display the photos for each clearing sale. The clearing sale information displays but the photos don't. Is there a better way of doing this? Thanks in advance. require "config.php"; $sql = mysql_query("SELECT * FROM `clearingsales` LEFT JOIN `clearingsales_photos` ON clearingsales.id = clearingsales_photos.parent_id ORDER BY `propertyname` LIMIT $from, $max_results") or die ("Could not query because: " . mysql_error()); while($row = mysql_fetch_array($sql)){ // Build your formatted results here echo '<b><center>'.$row['propertyname'].'</b><br />'; echo $date.' commencing '.$row['time'].'<br />'; echo 'A/c '.$row['accountname'].'</center><br />'; echo $row['comments'].'<br />'; echo '<div class=title2>'.$row['select1'].'</div> '.$row['txt1'].'<br />'; echo '<div class=title2>'.$row['select2'].'</div> '.$row['txt2'].'<br />'; echo '<div class=title2>'.$row['select3'].'</div> '.$row['txt3'].'<br />'; echo '<div class=title2>'.$row['select4'].'</div> '.$row['txt4'].'<br />'; echo '<div class=title2>'.$row['select5'].'</div> '.$row['txt5'].'<br />'; echo '<div class=title2>'.$row['select6'].'</div> '.$row['txt6'].'<br />'; echo '<div class=title2>'.$row['select7'].'</div> '.$row['txt7'].'<br />'; echo '<div class=title2>'.$row['select8'].'</div> '.$row['txt8'].'<br />'; echo '<div class=title2>'.$row['select9'].'</div> '.$row['txt9'].'<br />'; echo '<div class=title2>'.$row['select10'].'</div> '.$row['txt10'].'<br />'; echo '<div class=title2>'.$row['select11'].'</div> '.$row['txt11'].'<br /><br />'; } if (mysql_affected_rows() == 0) { print "No clearing sales to be displayed."; } $row = mysql_fetch_assoc($sql); $parent_id = $row['parent_id']; $filename = $row['filename']; $photos = $row['photos']; $query = "SELECT * FROM clearingsales_photos WHERE parent_id = '$parent_id'"; $result = mysql_query($query); $num = mysql_num_rows($result); $i=1; while ($i < $num) { echo '<a href=# onClick="popWin(\''.$filename.'.htm\', \'\', \'640\', \'480\')"><img src=http://www.domainname.com/folder1/fodler2/'.$photos.' border=0 /></a>'; } mysql_close(); Link to comment https://forums.phpfreaks.com/topic/36992-photos-arent-displaying/ Share on other sites More sharing options...
JasonLewis Posted February 4, 2007 Share Posted February 4, 2007 they just dont display, like... you dont get an invalid image link, or an error. its just blank where the photos are? Link to comment https://forums.phpfreaks.com/topic/36992-photos-arent-displaying/#findComment-176554 Share on other sites More sharing options...
cturner Posted February 4, 2007 Author Share Posted February 4, 2007 they just dont display, like... you dont get an invalid image link, or an error. its just blank where the photos are? There are photos added to the database. I have checked. Link to comment https://forums.phpfreaks.com/topic/36992-photos-arent-displaying/#findComment-176558 Share on other sites More sharing options...
JasonLewis Posted February 4, 2007 Share Posted February 4, 2007 try replaceing this: $query = "SELECT * FROM clearingsales_photos WHERE parent_id = '$parent_id'"; $result = mysql_query($query); $num = mysql_num_rows($result); $i=1; while ($i < $num) { echo '<a href=# onClick="popWin(\''.$filename.'.htm\', \'\', \'640\', \'480\')"><img src=http://www.domainname.com/folder1/fodler2/'.$photos.' border=0 /></a>'; } with this: $query = mysql_query("SELECT * FROM clearingsales_photos WHERE parent_id = '$parent_id'"); while ($r = mysql_fetch_array($query)) { echo '<a href=# onClick="popWin(\''.$row['filename'].'.htm\', \'\', \'640\', \'480\')"><img src=http://www.domainname.com/folder1/fodler2/'.$row['photos'].' border=0 /></a>'; } Link to comment https://forums.phpfreaks.com/topic/36992-photos-arent-displaying/#findComment-176564 Share on other sites More sharing options...
cturner Posted February 4, 2007 Author Share Posted February 4, 2007 This problem is now solved. Thanks to ProjectFear. Link to comment https://forums.phpfreaks.com/topic/36992-photos-arent-displaying/#findComment-176583 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.