Code: Select all
<?php
require_once ('../files/mysql_connect.php');
$cy = $_POST['city'];
if (!empty($_POST['city'])) {
$cy = escape_data($_POST['city']);
} else {
$cy = FALSE;
echo '<p><font color="red">Please enter a City</font></p>';
}
if ($cy) {
$query = "SELECT Table_1.id
, Table_1.LastName
, Table_1.FirstName
, Table_1.Phone1
, Table_1.city1
, Table_1.city2
, Table_1.city3
, Table_1.phone1
, Table_1.phone2
, Table_1.phone3
, Table_1.lastname
, COALESCE(Table_2.Notes, '') AS Notes
FROM Table_1
LEFT JOIN Table_2 ON (Table_2.id = Table_1.id)
WHERE (Table_1.city1 LIKE ('$cy%') OR Table_1.city2 LIKE ('$cy%') OR Table_1.city3 LIKE ('$cy%'))
ORDER BY Notes DESC, Table_1.lastname DESC";
}
$result = mysql_query ($query);
if (mysql_num_rows($result) == 0) {
echo "<tr><td colspan=\"5\">Currently, we do not feature that in our database.\n";
} else {
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) {
echo "
<tr>
<td>{$row['id']}</td>
<td>{$row['LastName']}</td>
<td>{$row['FirstName']}</td>
<td>{$row['Phone1']}</td>
</tr>
\n";
}
}
echo '</table>';
mysql_close();
?>What I'd like to be able to do, is to print those records with notes in bold, while keeping those without notes non-bold. Is that possible? Anyone know how to do it?
(Should mention I'm still newbish, so detailed help is appreciated!)