jaxdevil Posted July 27, 2008 Share Posted July 27, 2008 I have my database setup where EVERY cell for image_one, image_two, and image_three for every model (column `mod`) is the text 'missing'. Now what is happening is that somehow in the below code it is sending the output to not equal to 'missing', when they are equal to missing. What could this be? <?php if ( $medical == "Product") { ?> <? $images_query = "SELECT * FROM `images` WHERE `mod` = '$code' LIMIT 1"; $images_result = mysql_query($images_query) or die(mysql_error()); while($row = mysql_fetch_array($images_result)) { if ( $image_one != "missing") { $image_one = "/prod_images/".$code."/".$row['image_one'].".jpg"; } if ( $image_one == "missing") { $image_one = "/prod_images/missing.jpg"; } if ( $image_two != "missing") { $image_two = "/prod_images/".$code."/".$row['image_two'].".jpg"; } if ( $image_two == "missing") { $image_two = "/prod_images/missing.jpg"; } if ( $image_three != "missing") { $image_three = "/prod_images/".$code."/".$row['image_three'].".jpg"; } if ( $image_three == "missing") { $image_three = "/prod_images/missing.jpg"; } $image_mod = $row['mod']; ?> Link to comment https://forums.phpfreaks.com/topic/116893-solved-if-statement-doing-equal-to-for-not-equal-to-and-vice-versa/ Share on other sites More sharing options...
GingerRobot Posted July 27, 2008 Share Posted July 27, 2008 $image_one is undefined. You need to use $row['image_one']. Link to comment https://forums.phpfreaks.com/topic/116893-solved-if-statement-doing-equal-to-for-not-equal-to-and-vice-versa/#findComment-601117 Share on other sites More sharing options...
jaxdevil Posted July 27, 2008 Author Share Posted July 27, 2008 That was it man, I appreciate your help greatly! Thanks a million! SK Link to comment https://forums.phpfreaks.com/topic/116893-solved-if-statement-doing-equal-to-for-not-equal-to-and-vice-versa/#findComment-601171 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.