I am looking to query my database based on what the user would like to search by: Ex. (Zip, City, State, Name, Etc Etc). Let’s say I search by zip code, and there are 2 results in my SQL for that zip code.
I would like the results to be displayed in the following format on my webpage:
Company Name
Address
City, State Zip
Contact Us Link Link to Another Page
I use the following code for something similar but I display the results in a table with check-boxes.
<?php
while ($row = mysql_fetch_assoc($result))
{
echo '<tr><td>';
echo '<input type="checkbox" name="selected[]" value="'.$row['order_number'].'"/>';
echo '</td>';
foreach ($row as $key => $value)
echo '<td>'.htmlspecialchars($value).'</td>';
echo '</tr>';
}
?>
I really would like to display the results of the search in the format I explained above. I am lost on how to get the results I want. Any help is much appreciated!!
Thanks
Would it be possible to do this as well:
If the Company Name row in my SQL is blank/empty, skip over that row/entry and go to the next.
What you could do, is pull each piece of information individually from the resulting row (change the fields based on what you pull from the table):
or for table output