yoda
02-05-2003, 03:12 PM
hi, made a plain simple function to retrieve some data from a table but it screws up .. here's what i got
<--- header.php flie --->
echo data(tick);
echo mysql_error();
<--- config file --->
function data($option) {
$result = mysql_query("SELECT * FROM cw_data WHERE option='$option'");
$row = mysql_fetch_array($result);
$value = $row["value"];
return $value;
}
I did everything ok, db connection etc but this is what i get:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site99/fst/var/www/html/cw/cw/config_data.php on line 11
You have an error in your SQL syntax near 'option='tick'' at line 1 - Server Status:
thx in advance
<--- header.php flie --->
echo data(tick);
echo mysql_error();
<--- config file --->
function data($option) {
$result = mysql_query("SELECT * FROM cw_data WHERE option='$option'");
$row = mysql_fetch_array($result);
$value = $row["value"];
return $value;
}
I did everything ok, db connection etc but this is what i get:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site99/fst/var/www/html/cw/cw/config_data.php on line 11
You have an error in your SQL syntax near 'option='tick'' at line 1 - Server Status:
thx in advance