I cannot get the following if statement to work.
Code: Select all
if ($list = "IP") {
$query = mysql_query ("SELECT * FROM ip WHERE $list LIKE '%$search%'");
echo "<TABLE BORDER=\"0\" table width=\"100%\" cellspacing=\"1\" cellpadding=\"5\" bgcolor=\"#cccccc\" class=\"standard\">\n";
echo "<TR bgcolor=\"#efefef\"><TD font colour=\"red\" width=\"15%\"><b>Asset</b></TD></TR>\n";
while($rows=mysql_fetch_array($query)) ;
echo "<TR bgcolor=\"efefef\" onmouseover=this.className=\"test2\" onmouseout=this.className=\"test\" class=\"test\"><td><a href='viewasset.php?varl=".$rows["asset"]."' class=\"blue5\>".$rows["asset"]."</a></TD>\n";
echo "</TR>\n";
}
echo "</TABLE>\n";
}
else {
$result = mysql_query("SELECT * FROM dedicated WHERE $list LIKE '%$search%'");
echo "<TABLE BORDER=\"0\" table width=\"100%\" cellspacing=\"1\" cellpadding=\"5\" bgcolor=\"#cccccc\" class=\"standard\">\n";
echo "<TR bgcolor=\"#efefef\"><TD font colour=\"red\" width=\"15%\"><b>Asset</b></TD><TD width=\"30%\"><t><b>Title</b></TD><TD width=\"25%\"><b>IP Address</b></TD><TD width=\"15%\"><b>Reconciled</b></TD><TD width=\"5%\"></TD><TD width=\"5%\"></TD></TR>\n";
while($r=mysql_fetch_array($result)) {
echo "<TR bgcolor=\"efefef\" onmouseover=this.className=\"test2\" onmouseout=this.className=\"test\" class=\"test\"><td><a href='viewasset.php?varl=".$r["asset"]."' class=\"blue5\">".$r["asset"]."</a></td><td>".$r["title"]."</td><td>".$r["customer"]."</td><td>".$r["IP"]."</td><TD><a href='sysdocupdate3.php?varl=".$r['asset']."'><img src=\"edit.gif\" alt=\"Delete\" border=\"0\" /></a></TD><TD><a href='deleteget.php?varl=".$r['asset']."'><img src=\"b_drop.gif\" alt=\"Delete\" border=\"0\" /></a></TD>\n";
echo "</TR>\n";
}
echo "</TABLE>\n";
}