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=94503)

AN-net 08-17-2005 04:25 PM

mysql syntax error>_>
 
ok well i am completely confused to why this happening

the error is
Code:

Database error in vBulletin 3.0.7:

Invalid SQL: 
                                        INSERT INTO journals
                                                (journalist, journalist_id, journaldate,
                                        journaldesc, private, allowbuddies, whocanview, lastentry,
                                                lastentry_date, lastentry_misc, ipaddress, entrycount, active,privatecount
                                        )
                                VALUES
                                                ('Antonbomb22', '20',
                                                1124306286, '', 0, , '',
                                                'testing private entry', 1124306286,'a:3:{s:7:\"private\";i:1;s:10:\"whocanview\";s:0:\"\";s:12:\"allowbuddies\";i:0;}', '69.141.184.51'
                                                ,1,1,1
                                                )
                       
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 ' '',
                                                'testing private entry', 1124306286,'a:3:{s:7:\"private\";i:1;s:10:' at line 8

mysql error number: 1064

this is the php code/query:
PHP Code:

            $DB_site->query(
                    INSERT INTO "
.TABLE_PREFIX."journals 
                        (journalist, journalist_id, journaldate, 
                    journaldesc, private, allowbuddies, whocanview, lastentry, 
                        lastentry_date, lastentry_misc, ipaddress" 
. ($journal['usejournalname'] ? ', journalname' '') . "" . ($setting['autoapprove_entries']==', entrycount' '') . "" . ($setting['autoapprove_journals']==', active' '') . "" . ($addto['privatecount'] ? ',privatecount''') . "
                    ) 
                VALUES 
                        ('" 
addslashes($bbuserinfo['username']) . "', '" intval($bbuserinfo['userid']) . "', 
                        " 
TIMENOW ", '" addslashes($journal['description']) . "', " $journal['private'] . ", " $journal['allowbuddies'] . ", '" addslashes($journal['whocanview']) . "', 
                        '" 
addslashes($entry['title']) . "', " TIMENOW ",'"addslashes($lastentrymisc) ."', '" IPADDRESS "'
                        " 
. ($journal['usejournalname'] ? $nameformat '') . "" . ($setting['autoapprove_entries']==',1' '') . "" . ($setting['autoapprove_journals'] ? ',1' '') . "" . ($addto['privatecount'] ? ',1' '') . 
                        ) 
            "
); 

also why is there a 1 after 'active' and a 11 at the end of values. those should not be there.

any help would be appreciated.

edit:
fixed my active and stuff problems but still getting syntax error>_>

Marco van Herwaarden 08-17-2005 08:27 PM

Try using a value for allowbuddies (0, '' or NULL).

I don't see an 11.

AN-net 08-17-2005 09:15 PM

Quote:

Originally Posted by MarcoH64
Try using a value for allowbuddies (0, '' or NULL).

I don't see an 11.

ooo it worked, i think it was combination of that and several other things.
thank you so much

Marco van Herwaarden 08-17-2005 09:21 PM

No problem. :D


All times are GMT. The time now is 03:26 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.03772 seconds
  • Memory Usage 1,740KB
  • 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)bbcode_php_printable
  • (1)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