Ok I know this is easy to do but I’m obviously making it harder than it is. So I have a page that returns the search results of a database and displays them in rows with alternating colors but my problem is I need a header above each column. I can get a header above each column I just can’t get it to line up above the correct column, here is the actual page, http://jemtechnv.com/portal/inventory/inventory_search.php so above each column I need the name of that column, so, ID Part Number Model Number Serial Number and so on, my issue is I can get the column names in there but they repeat with each new row and or they wont line up over the correct column.
Here is my php code:
[php]// Connect to server and select databse
mysql_connect("$host", “$username”, “$password”)or die(“cannot connect”);
mysql_select_db("$db_name")or die(“cannot select DB”);
$sql=“SELECT * FROM $tbl_name”;
$result=mysql_query($sql);
// Define $color=1
$color=“1”;
echo ‘
ID | Part Number | Model Number | Serial Number | Manufacture | Availability | Quantity | Condition | Product Image | ’;
---|---|---|---|---|---|---|---|---|
".$rows['id']." | ".$rows['part_number']." | ".$rows['model_number']." | ".$rows['serial_number']." | ".$rows['part_manufacture']." | ".$rows['part_available']." | ".$rows['part_quantity']." | ".$rows['part_condition']." | ".$rows['part_image']." |
".$rows['id']." | ".$rows['part_number']." | ".$rows['model_number']." | ".$rows['serial_number']." | ".$rows['part_manufacture']." | ".$rows['part_available']." | ".$rows['part_quantity']." | ".$rows['part_condition']." | ".$rows['part_image']." |
mysql_close();
?>
[/php]