Hi there.
I have a MySQL query that checks a "Compatible" column for a number. For instance "1".
In this table there are 4 rows: Type, Compatible, StockLevel and Cost.
I need to display the Type field of every row in Compatible which matches the number 1.
EG:
TYPE COMPATIBLE
[Honda] - [1] - 0 - £1
[Ford] - [1] - 0 - £1
Currently I have
Code:$cartridge_query = mysql_query("SELECT * FROM cartridges WHERE Compatible LIKE '1'"); $cartridge_result = mysql_fetch_assoc($cartridge_query); $cartridge_count = mysql_num_rows($cartridge_query);I have a feeling I'm close but it's not working. Any ideas?Code:echo "<select>"; foreach ($cartridge_result["Compatible"] as '1') { echo "<option>".$cartridge_result["Type"]."</option>"; } echo "</select>";


Reply With Quote

Bookmarks