PDA

View Full Version : MySQL Query Issues


iDCamps
11-30-2010, 07:48 PM
Hello all,

I have an unusual query error. I'm using query_read(). In the query, I'm not doing anything too special. It LEFT JOINs two tables and gives each of them a synonym, and a few "AS" in the SELECT list. Other than that everything is a very standard SELECT query.

I get two PHP warnings, which are:
Warning: mysql_query() expects parameter 1 to be string, resource given in [path]/includes/class_core.php on line 413

Warning: chop() expects parameter 1 to be string, resource given in [path]/includes/class_core.php on line 1043

I made sure I am supplying a string.

The SQL query error is:
Database error in vBulletin 4.0.7:

Invalid SQL:
;

MySQL Error :
Error Number : 0
Request Date : Tuesday, November 30th 2010 @ 01:43:35 PM
Error Date : Tuesday, November 30th 2010 @ 01:43:35 PM
Script : http://mypage
Referrer : http://mypage
IP Address : 192.168.10.100
Username : Me
Classname : vB_Database
MySQL Version : 5.1.41-3ubuntu12.6

Any ideas?

Lynne
11-30-2010, 09:06 PM
How about posting your code.

iDCamps
11-30-2010, 09:35 PM
The SQL is:


SQL REMOVED


It runs if I use it directly from MySQL Workbench, so I'm sure it's valid.

Lynne
11-30-2010, 10:09 PM
You should not be going s.`id`, it should just be s.id. You readly don't need `` around anything there ... and common syntax is FROM id_serials AS s for that type of statement.

Also, since you are getting an empty sql statement, it really helps to see stuff around the statement, not just that little bit.

iDCamps
12-02-2010, 07:23 PM
Thanks for the assistance. I actually found the problem, it was a goofy little mistake.