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']; ?> Quote Link to comment 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']. Quote Link to comment 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 Quote Link to comment 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.