JTapp Posted May 22, 2008 Share Posted May 22, 2008 Here is my line.. if the image does not exist, I'm getting the standard missing icon on my webpage. Is there a way to customize/change the missing image icon when the image isn't there? echo "<img src='" . $imagesFolder . $row['companyid'] . ".jpg' /></p>"; Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/ Share on other sites More sharing options...
cordoprod Posted May 22, 2008 Share Posted May 22, 2008 if(file_exists(".$imagesFolder ". $row['companyid'] . ".jpg")) { echo "<img src='" . $imagesFolder . $row['companyid'] . ".jpg' /></p>"; } else { echo "IMAGE TO BE SHOWN"; } Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-547582 Share on other sites More sharing options...
pocobueno1388 Posted May 22, 2008 Share Posted May 22, 2008 Try this: <?php $file = $imagesFolder . $row['companyid'] . '.jpg'; if (file_exists($file)){ echo "<img src='" . $imagesFolder . $row['companyid'] . ".jpg' /></p>"; } else { echo echo "<img src='icon.jpg' /></p>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-547583 Share on other sites More sharing options...
947740 Posted May 22, 2008 Share Posted May 22, 2008 cordropod + pocobueno gave an example for my first sentence, so I just got rid of that. As far as the red x part, I do not think you can change that, but, if you can, it would probably be a CSS thing. Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-547584 Share on other sites More sharing options...
JTapp Posted May 22, 2008 Author Share Posted May 22, 2008 I tried both recommendations and got a blank page... In the past it seems I have been advised to use the - if (file_exists($file)){ - But I could never get it working... Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-547595 Share on other sites More sharing options...
cordoprod Posted May 22, 2008 Share Posted May 22, 2008 I tried both recommendations and got a blank page... In the past it seems I have been advised to use the - if (file_exists($file)){ - But I could never get it working... Can you show your whole code? Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-547597 Share on other sites More sharing options...
JTapp Posted May 22, 2008 Author Share Posted May 22, 2008 Ok - its hairy.. and I had changed my field name in my original post to make it easier for people to understand: <?php $username = "username"; $password = "pswd"; $hostname = "localhost"; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $selected = mysql_select_db("lodges",$dbhandle) or die("Could not select lodges"); $id = $_GET['id']; $query = mysql_query("SELECT a.strLodgeName, a.intLodgeNumber, a.intDistrictID, a.strLodgeWEB, a.strLodgeCounty, a.dtChartered, a.strLodgeMeetingPlace, a.strLodgeLocationCity, a.strLodgeLocationState, a.strLodgeLocationZip, a.strLodgeEmail, a.strLodgePhone, a.strLodgeFax, a.strDrivingDirectons, a.dtMeetingTime, a.strMeetingCodes, a.dtMealTime, a.strFloorSchool, a.strLodgeNews, a.strLodgePhotoPathAndName, b.strOfficerTitle, b.strFirstName, b.strLastName, b.BusinessPhone, b.PersEmail FROM tblLodges a LEFT JOIN tblOfficers b ON a.lngLodgeID = b.lngLodgeID WHERE a.intLodgeNumber=$id GROUP BY a.strLodgeName LIMIT 50")or die(mysql_error()); while ($row = @mysql_fetch_array($query)) { $variable1=$row["strLodgeName"]; $variable2=$row["intLodgeNumber"]; $variable3=$row["intDistrictID"]; $variable4=$row["strLodgeWEB"]; $variable5=$row["strLodgeCounty"]; $variable6=$row["dtChartered"]; $variable7=$row["strLodgeMeetingPlace"]; $variable8=$row["strLodgeLocationCity"]; $variable9=$row["strLodgeLocationState"]; $variable10=$row["strLodgeLocationZip"]; $variable12=$row["strLodgeEmail"]; $variable13=$row["strLodgePhone"]; $variable14=$row["strLodgeFax"]; $variable15=$row["strDrivingDirectons"]; $variable16=$row["dtMeetingTime"]; $variable17=$row["dtMealTime"]; $variable18=$row["strFloorSchool"]; $variable19=$row["strLodgeNews"]; $variable20=$row["strLodgePhotoPathAndName"]; $variable21=$row["strMeetingCodes"]; $imagesFolder = '/lodgeimages/'; //table layout for results echo "<center>\n"; echo "<p><H3>LODGE: $variable1</H4></p>"; //image to be displayed echo "<img src='" . $imagesFolder . $row['intLodgeNumber'] . ".jpg' /></p>"; echo "<p><b>Lodge Number:</b> $variable2</p>"; echo "<p><b>District Name:</b> $variable3</p>"; echo "<a href=\"$variable4\">Click Here To Go To The Lodge Website</a>"; echo "<p><b>Lodge County:</b> $variable5</p>"; echo "<p><b>Lodge Chartered On:</b> $variable6</p>"; echo "<p><b>Lodge Address: </b> $variable7</p>"; echo "<p>$variable8, $variable9 $variable10</p>"; echo "<a href=\"mailto:$variable12\">Click Here To Email The Lodge</a>"; echo "<p><b>Lodge Phone Number: </b> $variable13</p>"; echo "<p><b>Lodge FAX Number: </b> $variable14</p>"; echo "<p><b>Lodge Driving Directions:</b><a href='http://maps.google.com/maps?saddr=&daddr=".$variable7.", ".$variable8.", ".$variable9."' target='_blank'>Link</a></p>"; echo "<p<b>Lodge Meetings:</b> $variable21</p>"; echo "<p><b>Lodge Meeting Time:</b> $variable16</p>"; echo "<p><b>Lodge Meal Time:</b> $variable17</p>"; echo "<p><b>Lodge Floor School:</b> $variable18</p>"; echo "<p><b>Lodge News:</b> $variable19</p>"; echo "</center>\n"; } ?> <hr> <p> <?php //query details table begins $query = mysql_query("SELECT tblLodges.strLodgeName, tblLodges.intLodgeNumber, tblLodges.intDistrictID, tblLodges.strLodgeLocationCity, tblLodges.strLodgeLocationZip, tblLodges.strLodgeCounty, tblOfficers.lngLodgeID, tblOfficers.strOfficerTitle, tblOfficers.strFirstName, tblOfficers.strLastName, tblOfficers.BusinessPhone, tblOfficers.PersEmail FROM tblLodges LEFT JOIN tblOfficers ON tblLodges.lngLodgeID = tblOfficers.lngLodgeID WHERE tblLodges.intLodgeNumber=$id GROUP BY tblOfficers.lngOfficerTitleID LIMIT 0, 50")or die(mysql_error()); echo "<center>\n"; echo "<H2>Roster of Lodge Officers</H2>\n"; echo "<table border='1'> <tr> <th>Lodge Number</th> <th>Officer Title</th> <th>Officer First</th> <th>Officer Last</th> <th>Officer Email</th> <th>Officer Phone</th> </tr>"; if (mysql_num_rows($query)) { while ($row = mysql_fetch_array($query)) { $variable1=$row["intLodgeNumber"]; $variable2=$row["strOfficerTitle"]; $variable3=$row["strFirstName"]; $variable4=$row["strLastName"]; $variable5=$row["PersEmail"]; $variable6=$row["BusinessPhone"]; //table layout for results print("<tr>"); echo "<tr align=\"center\" bgcolor=\"#EFEFEF\">\n"; echo "<td class=\"td_id\">$variable1</td>\n"; echo "<td class=\"td_id\">$variable2</td>\n"; echo "<td class=\"td_id\">$variable3</td>\n"; echo "<td class=\"td_id\">$variable4</td>\n"; echo "<td class=\"td_id\">$variable5</td>\n"; echo "<td class=\"td_id\">$variable6</td>\n"; print("</tr>"); } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-547601 Share on other sites More sharing options...
cordoprod Posted May 22, 2008 Share Posted May 22, 2008 Try this: <?PHP $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $selected = mysql_select_db("lodges",$dbhandle) or die("Could not select lodges"); $id = $_GET['id']; $query = mysql_query("SELECT a.strLodgeName, a.intLodgeNumber, a.intDistrictID, a.strLodgeWEB, a.strLodgeCounty, a.dtChartered, a.strLodgeMeetingPlace, a.strLodgeLocationCity, a.strLodgeLocationState, a.strLodgeLocationZip, a.strLodgeEmail, a.strLodgePhone, a.strLodgeFax, a.strDrivingDirectons, a.dtMeetingTime, a.strMeetingCodes, a.dtMealTime, a.strFloorSchool, a.strLodgeNews, a.strLodgePhotoPathAndName, b.strOfficerTitle, b.strFirstName, b.strLastName, b.BusinessPhone, b.PersEmail FROM tblLodges a LEFT JOIN tblOfficers b ON a.lngLodgeID = b.lngLodgeID WHERE a.intLodgeNumber=$id GROUP BY a.strLodgeName LIMIT 50")or die(mysql_error()); while ($row = @mysql_fetch_array($query)) { $variable1=$row["strLodgeName"]; $variable2=$row["intLodgeNumber"]; $variable3=$row["intDistrictID"]; $variable4=$row["strLodgeWEB"]; $variable5=$row["strLodgeCounty"]; $variable6=$row["dtChartered"]; $variable7=$row["strLodgeMeetingPlace"]; $variable8=$row["strLodgeLocationCity"]; $variable9=$row["strLodgeLocationState"]; $variable10=$row["strLodgeLocationZip"]; $variable12=$row["strLodgeEmail"]; $variable13=$row["strLodgePhone"]; $variable14=$row["strLodgeFax"]; $variable15=$row["strDrivingDirectons"]; $variable16=$row["dtMeetingTime"]; $variable17=$row["dtMealTime"]; $variable18=$row["strFloorSchool"]; $variable19=$row["strLodgeNews"]; $variable20=$row["strLodgePhotoPathAndName"]; $variable21=$row["strMeetingCodes"]; $imagesFolder = '/lodgeimages/'; //table layout for results echo "<center>\n"; echo "<p><H3>LODGE: $variable1</H4></p>"; //image to be displayed $file = $imagesFolder . $row['companyid'] . '.jpg'; if (file_exists($file)){ echo "<img src='" . $imagesFolder . $row['companyid'] . ".jpg' /></p>"; } else { echo "<img src='icon.jpg' /></p>"; } echo "<p><b>Lodge Number:</b> $variable2</p>"; echo "<p><b>District Name:</b> $variable3</p>"; echo "<a href=\"$variable4\">Click Here To Go To The Lodge Website</a>"; echo "<p><b>Lodge County:</b> $variable5</p>"; echo "<p><b>Lodge Chartered On:</b> $variable6</p>"; echo "<p><b>Lodge Address: </b> $variable7</p>"; echo "<p>$variable8, $variable9 $variable10</p>"; echo "<a href=\"mailto:$variable12\">Click Here To Email The Lodge</a>"; echo "<p><b>Lodge Phone Number: </b> $variable13</p>"; echo "<p><b>Lodge FAX Number: </b> $variable14</p>"; echo "<p><b>Lodge Driving Directions:</b><a href='http://maps.google.com/maps?saddr=&daddr=".$variable7.", ".$variable8.", ".$variable9."' target='_blank'>Link</a></p>"; echo "<p<b>Lodge Meetings:</b> $variable21</p>"; echo "<p><b>Lodge Meeting Time:</b> $variable16</p>"; echo "<p><b>Lodge Meal Time:</b> $variable17</p>"; echo "<p><b>Lodge Floor School:</b> $variable18</p>"; echo "<p><b>Lodge News:</b> $variable19</p>"; echo "</center>\n"; } ?> <hr> <p> <?php //query details table begins $query = mysql_query("SELECT tblLodges.strLodgeName, tblLodges.intLodgeNumber, tblLodges.intDistrictID, tblLodges.strLodgeLocationCity, tblLodges.strLodgeLocationZip, tblLodges.strLodgeCounty, tblOfficers.lngLodgeID, tblOfficers.strOfficerTitle, tblOfficers.strFirstName, tblOfficers.strLastName, tblOfficers.BusinessPhone, tblOfficers.PersEmail FROM tblLodges LEFT JOIN tblOfficers ON tblLodges.lngLodgeID = tblOfficers.lngLodgeID WHERE tblLodges.intLodgeNumber=$id GROUP BY tblOfficers.lngOfficerTitleID LIMIT 0, 50")or die(mysql_error()); echo "<center>\n"; echo "<H2>Roster of Lodge Officers</H2>\n"; echo "<table border='1'> <tr> <th>Lodge Number</th> <th>Officer Title</th> <th>Officer First</th> <th>Officer Last</th> <th>Officer Email</th> <th>Officer Phone</th> </tr>"; if (mysql_num_rows($query)) { while ($row = mysql_fetch_array($query)) { $variable1=$row["intLodgeNumber"]; $variable2=$row["strOfficerTitle"]; $variable3=$row["strFirstName"]; $variable4=$row["strLastName"]; $variable5=$row["PersEmail"]; $variable6=$row["BusinessPhone"]; //table layout for results print("<tr>"); echo "<tr align=\"center\" bgcolor=\"#EFEFEF\">\n"; echo "<td class=\"td_id\">$variable1</td>\n"; echo "<td class=\"td_id\">$variable2</td>\n"; echo "<td class=\"td_id\">$variable3</td>\n"; echo "<td class=\"td_id\">$variable4</td>\n"; echo "<td class=\"td_id\">$variable5</td>\n"; echo "<td class=\"td_id\">$variable6</td>\n"; print("</tr>"); } } ?> It was to echo's in the else part.. Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-547608 Share on other sites More sharing options...
JTapp Posted May 22, 2008 Author Share Posted May 22, 2008 Well, I'm able to see the icon, but the icon shows up all of the time - regardless of if an image is there or not. Does that make sense? Basically, I want the icon to show up only if the image is missing.. Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-547617 Share on other sites More sharing options...
cordoprod Posted May 22, 2008 Share Posted May 22, 2008 Try to echo $file... Check if the path is right.. Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-547636 Share on other sites More sharing options...
Darklink Posted May 22, 2008 Share Posted May 22, 2008 I advise the file_exists function. <?php $filename = 'images/example.jpg'; if ( file_exists($filename) ) { $image = $filename; } else { $image = 'images/noimage.jpg'; } echo '<img src="' . $image . '" alt="" />'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-547661 Share on other sites More sharing options...
JTapp Posted May 22, 2008 Author Share Posted May 22, 2008 Try to echo $file... Check if the path is right.. can you explain this more? Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-547736 Share on other sites More sharing options...
JTapp Posted May 23, 2008 Author Share Posted May 23, 2008 anybody? Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-547814 Share on other sites More sharing options...
pocobueno1388 Posted May 23, 2008 Share Posted May 23, 2008 Try to echo $file... Check if the path is right.. can you explain this more? Like this <?php $file = $imagesFolder . $row['companyid'] . '.jpg'; echo $file; That will tell you if your variable is coming out as expected. Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-547815 Share on other sites More sharing options...
JTapp Posted May 23, 2008 Author Share Posted May 23, 2008 ahhh! Yes, in that particular case, it is displaying just the path but I've also tested echo "<img src='" . $imagesFolder . $row['companyID'] . ".jpg' /></p>"; and it works fine So the issue seems to be my personalized 'image not available' icon shows up when in fact there is an image available.. Hope this makes sense. thanks Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-547819 Share on other sites More sharing options...
JTapp Posted May 23, 2008 Author Share Posted May 23, 2008 Does that make sense? Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-548344 Share on other sites More sharing options...
thebadbad Posted May 23, 2008 Share Posted May 23, 2008 What does your path look like then? Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-548373 Share on other sites More sharing options...
sasa Posted May 23, 2008 Share Posted May 23, 2008 ahhh! Yes, in that particular case, it is displaying just the path but I've also tested echo "<img src='" . $imagesFolder . $row['companyID'] . ".jpg' /></p>"; and it works fine So the issue seems to be my personalized 'image not available' icon shows up when in fact there is an image available.. Hope this makes sense. thanks $row['companyID'] isn't same as $row['companyid'] Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-548388 Share on other sites More sharing options...
JTapp Posted May 23, 2008 Author Share Posted May 23, 2008 It's not 'companyID' or 'companyid'- I just used that to explain myself.. so that's not the issue. Here is the path: $file = $imagesFolder . $row['intLodgeNumber'] . '.jpg'; if (file_exists($file)){ echo "<img src='" . $imagesFolder . $row['intLodgeNumber'] . ".jpg' /></p>"; } else { echo "<img src='/Images/footerbar.GIF' /></p>"; } Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-548422 Share on other sites More sharing options...
JTapp Posted May 24, 2008 Author Share Posted May 24, 2008 What does your path look like then? This is what my path looks like - it the path for lodge number 147: /lodgeimages/147.jpg Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-548676 Share on other sites More sharing options...
JTapp Posted May 24, 2008 Author Share Posted May 24, 2008 Trying to troubleshoot all of the posted suggestions... poco, was the 'echo echo' in your last line a mistake? Try this: <?php $file = $imagesFolder . $row['companyid'] . '.jpg'; if (file_exists($file)){ echo "<img src='" . $imagesFolder . $row['companyid'] . ".jpg' /></p>"; } else { echo echo "<img src='icon.jpg' /></p>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-548683 Share on other sites More sharing options...
thebadbad Posted May 24, 2008 Share Posted May 24, 2008 Yes it was ^ Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-548773 Share on other sites More sharing options...
JTapp Posted May 24, 2008 Author Share Posted May 24, 2008 I took out the extra echo and still have the problem. Just so you guys know the line of code I am trying to do this with goes as follows: Photos are stored in an 'Images' file on my server. Let's just say each photo is named 'companynameID.jpg' (really called 'intLodgeNumber') in that folder. In my database there is a 'companynameID' field. So my code looks for the ID in the database and matches it to the image in the folder. Hence: echo "<img src='" . $imagesFolder . $row['intLodgeNumber'] . ".jpg' /></p>"; So I'm trying to make the entire line completely disappear when there is no image in the Images folder. It may be this is impossible to do..? Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-548905 Share on other sites More sharing options...
JTapp Posted May 24, 2008 Author Share Posted May 24, 2008 I guess another work around could be I can make an image that says "Photo not available" and call it na.jpg and whenever the photo is missing it would replace it with my na.jpg... I just have NO IDEA AT ALL on how to do that.... Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-549107 Share on other sites More sharing options...
runnerjp Posted May 24, 2008 Share Posted May 24, 2008 try this <?PHP $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $selected = mysql_select_db("lodges",$dbhandle) or die("Could not select lodges"); $id = $_GET['id']; $query = mysql_query("SELECT a.strLodgeName, a.intLodgeNumber, a.intDistrictID, a.strLodgeWEB, a.strLodgeCounty, a.dtChartered, a.strLodgeMeetingPlace, a.strLodgeLocationCity, a.strLodgeLocationState, a.strLodgeLocationZip, a.strLodgeEmail, a.strLodgePhone, a.strLodgeFax, a.strDrivingDirectons, a.dtMeetingTime, a.strMeetingCodes, a.dtMealTime, a.strFloorSchool, a.strLodgeNews, a.strLodgePhotoPathAndName, b.strOfficerTitle, b.strFirstName, b.strLastName, b.BusinessPhone, b.PersEmail FROM tblLodges a LEFT JOIN tblOfficers b ON a.lngLodgeID = b.lngLodgeID WHERE a.intLodgeNumber=$id GROUP BY a.strLodgeName LIMIT 50")or die(mysql_error()); while ($row = @mysql_fetch_array($query)) { $variable1=$row["strLodgeName"]; $variable2=$row["intLodgeNumber"]; $variable3=$row["intDistrictID"]; $variable4=$row["strLodgeWEB"]; $variable5=$row["strLodgeCounty"]; $variable6=$row["dtChartered"]; $variable7=$row["strLodgeMeetingPlace"]; $variable8=$row["strLodgeLocationCity"]; $variable9=$row["strLodgeLocationState"]; $variable10=$row["strLodgeLocationZip"]; $variable12=$row["strLodgeEmail"]; $variable13=$row["strLodgePhone"]; $variable14=$row["strLodgeFax"]; $variable15=$row["strDrivingDirectons"]; $variable16=$row["dtMeetingTime"]; $variable17=$row["dtMealTime"]; $variable18=$row["strFloorSchool"]; $variable19=$row["strLodgeNews"]; $variable20=$row["strLodgePhotoPathAndName"]; $variable21=$row["strMeetingCodes"]; $imagesFolder = '/lodgeimages/'; //table layout for results echo "<center>\n"; echo "<p><H3>LODGE: $variable1</H4></p>"; //image to be displayed $file = $imagesFolder . $row['companyid'] . '.jpg'; if (file_exists($file)){ echo "<img src='" . $imagesFolder . $row['companyid'] . ".jpg' /></p>"; } else { echo "i have no image "; } echo "<p><b>Lodge Number:</b> $variable2</p>"; echo "<p><b>District Name:</b> $variable3</p>"; echo "<a href=\"$variable4\">Click Here To Go To The Lodge Website</a>"; echo "<p><b>Lodge County:</b> $variable5</p>"; echo "<p><b>Lodge Chartered On:</b> $variable6</p>"; echo "<p><b>Lodge Address: </b> $variable7</p>"; echo "<p>$variable8, $variable9 $variable10</p>"; echo "<a href=\"mailto:$variable12\">Click Here To Email The Lodge</a>"; echo "<p><b>Lodge Phone Number: </b> $variable13</p>"; echo "<p><b>Lodge FAX Number: </b> $variable14</p>"; echo "<p><b>Lodge Driving Directions:</b><a href='http://maps.google.com/maps?saddr=&daddr=".$variable7.", ".$variable8.", ".$variable9."' target='_blank'>Link</a></p>"; echo "<p<b>Lodge Meetings:</b> $variable21</p>"; echo "<p><b>Lodge Meeting Time:</b> $variable16</p>"; echo "<p><b>Lodge Meal Time:</b> $variable17</p>"; echo "<p><b>Lodge Floor School:</b> $variable18</p>"; echo "<p><b>Lodge News:</b> $variable19</p>"; echo "</center>\n"; } ?> <hr> <p> <?php //query details table begins $query = mysql_query("SELECT tblLodges.strLodgeName, tblLodges.intLodgeNumber, tblLodges.intDistrictID, tblLodges.strLodgeLocationCity, tblLodges.strLodgeLocationZip, tblLodges.strLodgeCounty, tblOfficers.lngLodgeID, tblOfficers.strOfficerTitle, tblOfficers.strFirstName, tblOfficers.strLastName, tblOfficers.BusinessPhone, tblOfficers.PersEmail FROM tblLodges LEFT JOIN tblOfficers ON tblLodges.lngLodgeID = tblOfficers.lngLodgeID WHERE tblLodges.intLodgeNumber=$id GROUP BY tblOfficers.lngOfficerTitleID LIMIT 0, 50")or die(mysql_error()); echo "<center>\n"; echo "<H2>Roster of Lodge Officers</H2>\n"; echo "<table border='1'> <tr> <th>Lodge Number</th> <th>Officer Title</th> <th>Officer First</th> <th>Officer Last</th> <th>Officer Email</th> <th>Officer Phone</th> </tr>"; if (mysql_num_rows($query)) { while ($row = mysql_fetch_array($query)) { $variable1=$row["intLodgeNumber"]; $variable2=$row["strOfficerTitle"]; $variable3=$row["strFirstName"]; $variable4=$row["strLastName"]; $variable5=$row["PersEmail"]; $variable6=$row["BusinessPhone"]; //table layout for results print("<tr>"); echo "<tr align=\"center\" bgcolor=\"#EFEFEF\">\n"; echo "<td class=\"td_id\">$variable1</td>\n"; echo "<td class=\"td_id\">$variable2</td>\n"; echo "<td class=\"td_id\">$variable3</td>\n"; echo "<td class=\"td_id\">$variable4</td>\n"; echo "<td class=\"td_id\">$variable5</td>\n"; echo "<td class=\"td_id\">$variable6</td>\n"; print("</tr>"); } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/106818-solved-when-image-is-missing-how-to-display-my-own-icon-instead-of-red-x/#findComment-549113 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.