vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Mass Update (MySQL & PHP) (https://vborg.vbsupport.ru/showthread.php?t=52869)

SiGmA_X 05-14-2003 03:48 PM

Okay, still is erroring..[sql]UPDATE pchm_affiliates SET impressions = IF (

id = 8,
'977',
IF (
id = 3,
'2062',
IF (
id = 4,
'996',
IF (
id = 7,
'941',
IF (
id = 5,
'1797',
IF (
id = 10,
'942',
IF (
id = 1,
'1976',
IF (
id = 6,
'1963',
IF (
id = 2,
'1973',
IF (
id = 9,
'940',
IF (
id = 11,
'834'
)
)
)
)
)
)
)
)
)
)
) WHERE id IN ( 8, 3, 4, 7, 5, 10, 1, 6, 2, 9, 11 ) [/sql]
Code:

Error:
MySQL said:

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
') ) ) ) ) ) ) ) ) ) ) WHERE id IN ( 8, 3, 4, 7, 5, 10, 1, 6, 2,

Help?

filburt1 05-14-2003 04:15 PM

Do you have the correct number of closing parens? Also you'll need a final dummy ELSE value.

Xenon 05-14-2003 04:26 PM

exactly a final , '' before the first closing ) is needed

SiGmA_X 05-15-2003 12:25 AM

Thank you Xenon, I see now. 1 sec.. Awsome! It now works :) Thank you all.

Oh, and about that count problem I was having.. I got it! Just needed a GROUP BY:[sql]SELECT news.id AS newsid, COUNT(*) AS count
FROM post AS post, pchm_news AS news
WHERE post.threadid = news.forumid
GROUP BY news.id LIMIT 0,30[/sql]


All times are GMT. The time now is 01:42 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.00921 seconds
  • Memory Usage 1,713KB
  • 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)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete