Jump to content

[SOLVED] If statement doing equal to for not equal to and vice versa


jaxdevil

Recommended Posts

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'];
?>

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.