Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-04-2004, 07:14 AM
tehste tehste is offline
 
Join Date: Feb 2004
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default MYSQL error 1064

I tried looking through all the threads but I could not find an answer.

I'm making a hack and getting a 1064 error when i try to insert a new row through the admin cp.

I would appreciate help with this.

error
Quote:
Database error in vBulletin 3.0.0 Release Candidate 4:

Invalid SQL:
INSERT INTO hack_settings
(ON,ALL,PST,RFRL,NSUP,INTR,CCST,CREV,CLIC,SELL,LOG ) VALUES('0','0','','','','','','','','','0')

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 'ON,ALL,PST,RFRL,NSUP,INTR,CCST,CREV,CLIC,SELL,LOG ) VALUES('0','

mysql error number: 1064
The table and colomns exist and im really puzzeled about this.

PHP
PHP Code:
    $DB_site->query("
        INSERT INTO " 
TABLE_PREFIX "hack_settings
        (ON,ALL,PST,RFRL,NSUP,INTR,CCST,CREV,CLIC,SELL,LOG) VALUES('
$settings[ON]','$settings[ALL]','$settings[PST]','$settings[RFRL]','$settings[NSUP]','$settings[INTR]','$settings[CCST]','$settings[CREV]','$settings[CLIC]','$settings[SELL]','$settings[LOG]')
    "
); 
Thanks for any help
Reply With Quote
  #2  
Old 03-04-2004, 01:43 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're probably best asking this in the HTL thread I can't see anything wrong on first glance...
Reply With Quote
  #3  
Old 03-04-2004, 03:00 PM
tehste tehste is offline
 
Join Date: Feb 2004
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dean C
You're probably best asking this in the HTL thread I can't see anything wrong on first glance...
its nothing to do with HTL.
i cant see anything wrong. Yet I'm getting a syntax error (1064).
Anyone have any ideas?
Reply With Quote
  #4  
Old 03-04-2004, 03:07 PM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try adding a space after VALUES
Reply With Quote
  #5  
Old 03-04-2004, 03:39 PM
tehste tehste is offline
 
Join Date: Feb 2004
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i tried that i have also tried putting ". and ." round the vars. and putting spaces after ,. but nothing is working. I have tried using an update query and that too is not working. In other parts of this hack (IE: outside the admin cp) my queries are fine.

Any includes i may have missed?
Reply With Quote
  #6  
Old 03-05-2004, 07:22 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

"ON" and "ALL" are reserved words of MYSQL so they should never be used as table field names. Otherwise this happens..

Quoting them in your query might or might NOT help depending on your MYSQL configuration..
Reply With Quote
  #7  
Old 03-05-2004, 08:35 AM
tehste tehste is offline
 
Join Date: Feb 2004
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Logician
"ON" and "ALL" are reserved words of MYSQL so they should never be used as table field names. Otherwise this happens..

Quoting them in your query might or might NOT help depending on your MYSQL configuration..
i thought that might be it. is LOG also reserved?
Reply With Quote
  #8  
Old 03-05-2004, 11:45 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nope.. http://rucus.ru.ac.za/docs/mysql/Res...served%20words
Reply With Quote
  #9  
Old 03-05-2004, 01:05 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by zsdave
i thought that might be it. is LOG also reserved?
It might not be a keyword, but it is probably a function name (logarithm).
Reply With Quote
  #10  
Old 03-05-2004, 03:17 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry to drift off topic - but what is a .za domain? Zambia?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:30 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04440 seconds
  • Memory Usage 2,265KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete