Hey guys, I'm new to PHP, I had this small program made for me, and it gives an error, I was wondering if anyone could help me out.
The error is:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site8/fst/var/www/html/product.php on line 39
Here's the code:
$link = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
mysql_select_db($mysql_db);
function display_value($request) {
global $mysql_db, $link;
$part_product = $_SERVER["PATH_INFO"];
$q = "SELECT $request FROM $mysql_table WHERE product_name='$part_product'";
$r = mysql_query($q);
$result = mysql_fetch_array($r);
echo $result[0];
}
Line 39 is: $result = mysql_fetch_array($r);
Thanks in advance for your replys!