Hey Everyone,
I am having a problem trying to send a simple fetch query to my database. I've been staring at it for over an hour and can't see what the problem is. The code...
$query = "select job_title from $db_name.$string
where job_id = '$job_id'";
$result = mysql_query($query);
echo "result: " . $result[0];
$rows = mysql_fetch_row($result);
echo "$rows[0]";
And the error...
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /var/www/scripts/get_client_jobs.php on line 45
The database and table names are correct, as are the field names. I can run the query directly in the databse and it produces the desired result, but for some reason when using the php functions, it won't return a valid resource. I'm using PHP 4.2.1 and MySQL 4.0.1-alpha. Any ideas?
dan