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.

No comments posted yet

Your Answer:

Login to answer
109 Like 9 Dislike
Previous forums Next forums
Other forums

Consuming third party Payment Gateway API from Procedure.
Hi All,

First of all i would like to thank all the people of the oracle forum for providi

Redirecting Admin
In my members table, I have a field called "perm" and it's set to zero for all members. Ho

Displaying data from MySql a different way
Hi all,
I'm pretty new to php and MySql and have hit a problem.

I am able to display data

php/xmlrpc class issue
I am working on xml-rpc in php to start with.

I have a class that only has variables defined

Credit card verification
I have a client who wants to process credit card transactions from his web site rather than the goin

How do I replace any number of character occurences with one occurrence?
How do I replace any number of character occurences with one occurrence?

Let's say I have:

Working with Global Variables
hi, I'm not really sure why the following code is returning a "Call to a member function getBan

problem with sql querry in php script
Hello guys,

What I want to do is I want to read out a csv file and then but te conent ot the

why aint this working?
i have this code:

Code: $num = 250;
$count = ($num - $rcount);

echo $rc

Retrieving innerHTML with cURL?
Hey all (sorry I know I'm a leecher, but I soon won't be. This is my first PHP project, but not my l

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