vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   What is wrong with this query? (https://vborg.vbsupport.ru/showthread.php?t=172414)

MrApples 03-08-2008 03:17 AM

What is wrong with this query?
 
This is probably something really easy that I'm an idiot for not spotting...

Code:

INSERT INTO
mylogs(
`occur`,`ip`,`ip2`,`agent`,
`refer`,`request`,`host`,`lang`,
`chars`,`encode`,`accept`,`protocol`,
`port`,`con`,`query_string`,`remote_user`,
`path_info`)
VALUES(
`1204953122`,`########`,``,`Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12`,
``,`/awesome.php`,``,`en-us,en;q=0.5`,
`ISO-8859-1,utf-8;q=0.7,*;q=0.7`,`gzip,deflate`,`text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5`,`HTTP/1.1`,
`80`,`keep-alive`,``,``,
``)

I've spent over an hour trying to figure out this syntax error. Now the MySQL claims that the column "1204953122" does not exist in 'field set'. That should be the first value.

Note: IP replaced with ####

Dismounted 03-08-2008 03:19 AM

What's the error it's telling you?

MrApples 03-08-2008 03:21 AM

Code:

#1054 - Unknown column '1204953122' in 'field list'
Before that it was incorrect MySQL version on line 1, I'm not sure what I did which switched the error.

MoT3rror 03-08-2008 03:42 AM

Use `table` for defining tables and columns and 'some kind of data' for data.

yellowpinky 03-08-2008 03:43 AM

I would try it without any single quotes (backward apostrophe) in the first half of the statement

then in the values part, use the single quote ' character instead of the ` backward apostrophe.

MrApples 03-08-2008 03:52 AM

Quote:

I would try it without any single quotes (backward apostrophe) in the first half of the statement

then in the values part, use the single quote ' character instead of the ` backward apostrophe.
I'm shocked but that worked, thanks.

Dismounted 03-08-2008 04:00 AM

You only really need to use backticks (`) if you're using reserved MySQL keywords.


All times are GMT. The time now is 04:52 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.01388 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_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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