vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   MySQL Query Issues (https://vborg.vbsupport.ru/showthread.php?t=254480)

iDCamps 11-30-2010 07:48 PM

MySQL Query Issues
 
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:

Code:

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.


All times are GMT. The time now is 09:14 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01017 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete