Hello,
Im trying to make a query which when called calls the specific data from DB and displays on product page..
the query works like this:
producttest.php?model=(modelnumberhere)
it works when i put:
producttest.php?model=1100
BUT
when i put:
producttest.php?model=n90
it comes up with: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource.
Is there something im doing wrong with my query? im using this query to select the data from DB:
<?php
if ($_GET['model']) {
require('conn.php');
$q = "SELECT * FROM products WHERE model = {$_GET['model']}";
$r = mysql_query ($q);
$row = mysql_fetch_array($r, MYSQL_ASSOC);
mysql_close();
} else {
header ("Location: [url]http://[/url]" .$_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) ."/index.php");
}
?>
Please somebody help i have been doing this all day and im ready to boot my computer screen across the office..
Thanks
Chris