I'm getting this error, Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result, from the follow piece of code and I don't know why. If I put the query straight into the mysql console the query gives the correct result but the mysql_fetch_array still bugs out. I've used the same syntax in dozens of queries prior to this so i'm completely lost.
$query = "SELECT DISTINCT Color FROM oemtoprinter WHERE (Part<>'Solid Ink' AND Part<>'Refill Kit' AND Color<>'NA' AND Color<>'N/A')";
$result = mysql_query($query,$connection);
confirm_query($result);
while ($result_item = mysql_fetch_array($result)) {
$color = $result_item['Color'];
$query = "INSERT INTO prod_options_values (product_options_values_name,products_options_values_sort_order) VALUES ('$color','1')";
$result = mysql_query($query, $connection);
confirm_query($result);
results from mysql console,
mysql> SELECT DISTINCT Color FROM oemtoprinter WHERE (Part<>'Solid Ink' AND Part
<>'Refill Kit' AND Color<>'NA' AND Color<>'N/A');
+---------------+
| Color |
+---------------+
| Black |
| Color |
| Cyan |
| Magenta |
| Yellow |
| Photo Cyan |
| Photo Magenta |
| Photo Black |
| Matte Black |
| Photo Color |
| Green |
| Red |
| Waterfast |
+---------------+
13 rows in set (0.01 sec)