Hi all,
I have been playing around with the code below and it will display Empty-mediadb1 and Empty-company if the search term (e.g. 1:00-10) does not exist. If it does exist, it displays the value located in mediadb1 and company. This is exactly how i want it. The only problem is that I have over 300 records that i need to search for in the `like
<?
// search for 1:00-10
session_start();
include_once”config.php”;
$result = mysql_query( “SELECT * FROM user WHERE mediadb1 LIKE ‘1:00-10′” )
or die(“SELECT Error: “.mysql_error());
while ($row=mysql_fetch_array($result)) {
$reps.=$row[“mediadb1”];
$comp.=$row[“company”];
}
if($reps == NULL) {
$reps=’Empty-mediadb1′;
$comp=’Empty-company’;
}
else {
}
// search for 1:10-20
$result2 = mysql_query( “SELECT * FROM user WHERE mediadb1 LIKE ‘1:10-20′” )
or die(“SELECT Error: “.mysql_error());
while ($row2=mysql_fetch_array($result2)) {
$reps2.=$row2[“mediadb1”];
$comp2.=$row2[“company”];
}
if($reps2 == NULL) {
$reps2=’Empty-mediadb1′;
$comp2=’Empty-company’;
}
else {
}
?>
<table width=”400″ border=”0″ cellspacing=”0″ cellpadding=”0″ align=”center”>
<tr>
<!– display 1:00-10 –>
<td width=”100″ align=”right”>1:00-10</td><td width=”150″ align=”right”><?php print $reps?></td> <td width=”150″ align=”right”><?php print $comp?></td>
</tr>
<tr>
<!– display 1:10-20 –>
<td width=”100″ align=”right”>1:10-20</td><td width=”150″ align=”right”><?php print $reps2?></td> <td width=”150″ align=”right”><?php print $comp2?></td>
</tr>
</table>