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

[PHP HELP] Php order form.
Hello to everyone @ phpfreaks. Im new to this site and hope to learn lots of things here.

Fir

Class not found error
I am getting Class 'index' not found in Eval function:

//write config

$pat

Variables and Include
Code: [Select]<?php

$header = $_COOKIE['mss']['header'];
$body = $_COOKIE['mss']['b

Email Processor
I have a few questions so this post will be a larger one! Sorry, but I'm a bit of a PHP newbie so be

C++ Http request?
Code: string Response = "LOGIN_UNSUCCESSFUL"; System.Net.WebRequest request = Sy

Batch Related Pricing
Hi, I need some clarity on the batch related pricing

For example the following are the b

Calling a Procedure with IN & OUT Parameters
Hello,

I usually call my procedures using the following way

declare variable e

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

defining website tags
Hi,

What would be the best way to define tags for my site, such as website title, url etc.

TinyMCE / Ajax Postback Problem
Hiya all,

I have a page which loads the TinyMCE editor. On the postback I obviously want to f

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