Jump to content

If statements with MySQL?


Nymphetamine

Recommended Posts

<?php
$result = mysql_query("SELECT * FROM ###########");
while($row = mysql_fetch_assoc($result)){
echo "<td>";

if ($row['date'] == '0501' && $row['property'] == '1') {
echo "$row[name]";
}
else {
echo "Empty";
}
        echo "</td><td>";

if ($row['date'] == '1201' && $row['property'] == '1') {
echo "$row[name]";
}
else {
echo "Empty";
}

        echo "</td><td>";

if ($row['date'] == '1901' && $row['property'] == '1') {
echo "$row[name]";
}
else {
echo "Empty";
}

        echo "</td>";

}
?>

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.