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;
Did you know?Explore Trending and Topic pages for more stories like this.
$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

Can anyone give me some link on .htaccess tutorial
i wish to have friendly url using .htaccess, but no idea yet about this

Hope that anyone cou

PHP Include not working
The website is http://www.grlistingservices.com

The code block is as follows:

<

A WBS element with the name XXX already exists in version FREI_VERSION
Hi.
When I am trying to insert WBS element in a project, error occurs:

"A WBS eleme

Line break?
Hi, I'm new to the forum and new to php. I'm not sure if I'm using the correct terminology so here i

Need help with an email blocker for a guessbook
I am new with php and here is a simple guessbook page but I am being hit with spam from a group of t

Get ID from Database when Posting with a HTML Form
I have a form I am submitting to a MySql database. Each product has an ID # attached to it that auto

simplexml and xpath - Need some help
Hello,

I am trying to parse an xml which comes back from Amazon and I am trying to know how m

File upload issues
Hi Guys,

Can anyone see any issues with this code:
Code: [Select]$setImage= 'productimages

php form help
Hey,

I use a control file to set my meta tags and titles

Here's an example
Code: &a

Taylor Series Function
So I am working a a project for my intro C++ class, and I am having some trouble with a function for

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