Hi all
I apologies again in advance for the seemingly stupid question. I have tried googling this once but can't see to get the answer i'm looking for.
Basically i have a form which can query the database depending upon what the user has selected. The trouble is if multiple results come up when it comes to building the table for the output, it seems to link it all together in one big table without putting a break in between results.
I suspect that the problem lies with the WHILE statement not being setup correctly for this particular type of setup, however i'm not 100% sure which type of statement i should be using instead.
Current snipit of the code:
if ($search_enhance == 0) {
// Search query without LIKE flag
$result = mysql_query("SELECT * FROM db_routers WHERE " . $search_type . "='" . $search_string . "' ORDER BY ID ASC");
}
else {
// Search query with LIKE flag
$result = mysql_query("SELECT * FROM db_routers WHERE " . $search_type . " LIKE '%" . $search_string . "%' ORDER BY ID ASC");
}
// Get the results from the database
while($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td><b>ID</b></td>";
echo "<td>" . $row['ID'] . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td><b>Dispatch Time</b></td>";
echo "<td>" . $row['dispatchtime'] . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td><b>Company Name</b></td>";
echo "<td>" . $row['company'] . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td><b>Dispatched By</b></td>";
echo "<td>" . $row['dispatchedby'] . "</td>";
echo "</tr>";
echo "<p>";
}