Page 1 of 1

MySQL not accepting my query string

Posted: Thu Mar 25, 2010 4:00 pm
by andrew_hodgson
I can't understand why this is not working, the query string looks line to me, or am I just being blind!

Code: Select all

$query  = "SELECT * ";
$query .= "FROM subjects ";
$query .= "WHERE id=" . $subject_id . " ";
$query .= "LIMIT 1";
    
$result_set = mysql_query($query, $connection);
confirm_query($result_set); 
when I echo the query string it looks like this,

Code: Select all

SELECT * FROM subjects WHERE id=1 LIMIT 1
I'm getting the error back from the confirm_query function and my php error log is giving me this to think about,
mysql_query(): supplied argument is not a valid MySQL-Link resource

Re: MySQL not accepting my query string

Posted: Thu Mar 25, 2010 5:17 pm
by andrew_hodgson
Can a mod delete this thread, there is nothing wrong with the string, I hadn't open the connection before I called the function to query the db.