getting weird error..


Posted on 16th Feb 2014 07:03 pm by admin

okay, I'm getting an error on this particular function, something about the syntax in the mysql LIMIT statement, but as far as I can see I have it right, currently using easymysql3.0 as test server, which was latest version as of a couple weeks ago.

Code: function get_subject_by_id($subject_id) {
global $connection;
$query = "SELECT * ";
$query .="FROM subjects ";
$query .="WHERE id=" . $subject_id . " ";
$query .="LIMIT 1"; //this is the line I'm having problems with comes up as syntax error ***this is where problem is at least the one I know about***
$result_set = mysql_query($query, $connection);
confirm_query($result_set);
//if no rows are returned fetch array will return false
if ($subject = mysql_fetch_array($result_set)) {
return $subject;
} else {
return NULL;
}
}
I'd really appreciate the help, thanks for looking at it.

109 Like 9 Dislike
Previous php-forum Next php-forum
Other php-forum

Can't find the problem (no error message)!
OK, here's the deal. This code is really weirdly formatted (sorry!) and hard to understand, so I'm g

How to display objects in a row
I have 7 codes that i want to display in a row one next to another.
The first is {$ads->ad

Embed Video Problem
Hey, thanks for looking!

File to be embedded:

Code: <playlist version="1&q

'grab_files', multiple extension?
hey guys,

can anyone suggest a way to make to following line of code look for files with more

Parse error: parse error in C:wampwwwlogspagesmembers.php on line 16
I dont see the problem with this, I always get Parse error: parse error in C:wampwwwlogspagesme

Run function every 5 mins ??
I have a function PostMessage()

How can I run it every 5 mins ??

check if value exists
I have googled this for a while and I am getting lots of different results. Is there a standard meth

SESSION question
I am building an application , a directory for auctions.
For SEO i made a script which copies a p

single page with referrer to show correct page
I have a simple website with a couple of different pages. I would like to be able to in a div tag w

Sql and php order list script problems
Hi im having a few problems with trying to get the coding right on a orders list ive done (or trying

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash