vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   mysql syntax error (https://vborg.vbsupport.ru/showthread.php?t=61923)

AN-net 02-25-2004 10:01 PM

mysql syntax error
 
what did i do wrong?
Quote:

Originally Posted by Mysql
Database error in vBulletin 3.0.0 Release Candidate 4:

Invalid SQL: SELECT * FROM gallery WHERE gallery_id='1',image_name='bacon1' ORDER BY gallery_id DESC
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'image_name='bacon1' ORDER BY gallery_id DESC' at line 1

mysql error number: 1064

Date: Wednesday 25th of February 2004 05:57:42 PM
Script: http://www.animationation.net/commun...DESC&gallery=1
Referer: http://www.animationation.net/commun....php?do=search
Username: Antonbomb22
IP Address: 68.37.175.197


Andreas 02-25-2004 10:04 PM

I guess you want this:

[sql]
SELECT * FROM gallery WHERE gallery_id='1' AND image_name='bacon1' ORDER BY gallery_id DESC
[/sql]

Btw: I'd be interested in a beta or even alpha version of your gallery :)

AN-net 02-25-2004 10:36 PM

whats wrong with it now>_<
Quote:

Originally Posted by mysql
Database error in vBulletin 3.0.0 Release Candidate 4:

Invalid SQL: SELECT * FROM gallery WHERE gallery_id='' , image_name='', artist_name='antonbomb22' ORDER BY gallery_id DESC
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' image_name='', artist_name='antonbomb22' ORDER BY gallery_id

mysql error number: 1064

Date: Wednesday 25th of February 2004 06:35:07 PM
Script: http://www.animationation.net/commun...d&orderin=DESC
Referer: http://www.animationation.net/commun....php?do=search


Andreas 02-25-2004 10:44 PM

Well, same problem as before ;)

[sql]
SELECT * FROM gallery WHERE gallery_id='' AND image_name='' AND artist_name='antonbomb22' ORDER BY gallery_id DESC
[/sql]

You might also put OR instead of AND (or AND NOT, or ...), depends on what you want to achieve.


All times are GMT. The time now is 02:28 PM.

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.00973 seconds
  • Memory Usage 1,719KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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