ok so here is the deal. I have a table that displays the result of a query. I need the odd work order numbers ($num) to be in one color while the evens are in another. I have the code that is written. I need to work this new color code into the code i already have here is my code
<?php
$num = trim($_POST["num"]);
$user = addslashes(trim ($_POST["user"]));
$start_date = trim ($_POST["start_date"]);
$end_date = trim ($_POST["end_date"]);
$campus = trim ($_POST["campus"]);
$building_alfred = addslashes(trim ($_POST["building_alfred"]));
$building_wellsville = addslashes(trim ($_POST["building_wellsville"]));
$room = addslashes(trim ($_POST["room"]));
$problem = trim ($_POST["problem"]);
$summary = addslashes(trim ($_POST["summary"]));
$description = addslashes(trim ($_POST["description"]));
$status = trim($_POST["status"]);
?>
<?php
$sql = "";
if(!empty($num)){
if (empty($sql)){
$sql = $sql."WHERE";
}else{
$sql = $sql."AND";
}
$sql = $sql." id LIKE '%$num%' ";
}
if(!empty($user)){
if (empty($sql)){
$sql = $sql."WHERE";
}else{
$sql = $sql."AND";
}
$sql = $sql." Requestor_Name LIKE '%$user%' ";
}
if(!empty($campus)){
if (empty($sql)){
$sql = $sql."WHERE";
}else{
$sql = $sql."AND";
}
$sql = $sql." Campus LIKE '%$campus%' ";
}
if(!empty($building_alfred)){
if (empty($sql)){
$sql = $sql."WHERE";
}else{
$sql = $sql."AND";
}
$sql = $sql." Building LIKE '%$building_alfred%' ";
}
if(!empty($building_wellsville)){
if (empty($sql)){
$sql = $sql."WHERE";
}else{
$sql = $sql."AND";
}
$sql = $sql." Building LIKE '%$building_wellsville%' ";
}
if(!empty($room)){
if (empty($sql)){
$sql = $sql."WHERE";
}else{
$sql = $sql."AND";
}
$sql = $sql." Room LIKE '%$room%' ";
}
if(!empty($problem)){
if (empty($sql)){
$sql = $sql."WHERE";
}else{
$sql = $sql."AND";
}
$sql = $sql." Problem LIKE '%$problem%' ";
}
if(!empty($summary)){
if (empty($sql)){
$sql = $sql."WHERE";
}else{
$sql = $sql."AND";
}
$sql = $sql." Summary LIKE '%$summary%' ";
}
if(!empty($description)){
if (empty($sql)){
$sql = $sql."WHERE";
}else{
$sql = $sql."AND";
}
$sql = $sql." Description LIKE '%$description%' ";
}
if(!empty($status)){
if (empty($sql)){
$sql = $sql."WHERE";
}else{
$sql = $sql."AND";
}
$sql = $sql." Status LIKE '%$status%' ";
}
if(!empty($start_date)){
if (empty($sql)){
$sql = $sql."WHERE";
}else{
$sql = $sql."AND";
}
$sql = $sql." Date_Submitted >= '$start_date' ";
}echo("start date: ".$start_date."<br>");
if(!empty($end_date)){
if (empty($sql)){
$sql = $sql."WHERE";
}else{
$sql = $sql."AND";
}
$sql = $sql." Date_Submitted <= '$end_date' ";
}echo("end date: ".$end_date."<br>");
$sql = "SELECT * FROM workorder ".$sql.";";
?>
<?php
$link = mysql_connect("localhost", "uname", "pass");
mysql_select_db("helpdesk", $link);
$results = mysql_query($sql, $link);
$num_rows = mysql_num_rows($results);
echo "$num_rows Records Found\n";
?>
<div id="content">
<table align="center" class="styled_results">
<tr>
<th class="clean">Edit</th>
<th>W.O.#</th>
<th>Requestor</th>
<th>Date Submitted</th>
<th>Location</th>
<th>Problem Type</th>
<th>Summary</th>
<th>Status</th>
</tr>
<?php
while ($row = mysql_fetch_assoc($results)) {
echo '<tr>';
echo '<td> <img src="../common/images/edit.gif"> </td>';
echo '<td>'.$row["id"].'</td>';
echo '<td>'.$row["Requestor_Name"].'</td>';
echo '<td>'.$row["Date_Submitted"].'</td>';
echo '<td>'.$row["Campus"].'<br>'.$row["Building"].'<br>'.$row["Room"];
echo '<td>'.$row["Problem"].'</td>';
echo '<td>'.$row["Summary"].'</td>';
echo '<td class = "wrap">'.$row["Status"].'</td>';
echo '</tr>';
}
mysql_free_result($results);
?>
</table>
<br>
<div align="center"><INPUT TYPE="button" onClick="parent.location='admin_search.php'" value="Start a New Search"></div>
</div>
Please help me. I am at my wits end. I have to have this in by tomorrow!!!! 😕