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

Database 'Validation'
Hi everyone,
I'm trying to validate the password entered by the user with the password in the dat

How to sum these output values
Hi

I need sum the month totals
SELECT region_name, area_name ,SUM (CASE WHEN S

Displaying returned XML in another PHP page
I have an online payment form that will return XML given if a payment is successful or declines. I

Collecting AOL Search Terms
I am attempting to collect AOL search terms. I know the code is correct (it works for google, bing,

What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is goin

array ...
hi
Code: function formatCategories($categories, $parentId)
{
// $navCat stores all child

Displaying image pathname instead of image
Hello

Im trying to upload and then display images from a mysql database - Its only basic and

TimeZoneOffset
Hello,

Please i need your help. I have a system that users can use to punch in and out. This

mod_rewrite.c on windows ??
why it's not working on windows while it's working on other hosts???

this is the code i got

mail() problem
Hi Guys,

I've set up a contact email form. It sends the information fine, but it sends it to

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