vb.org Archive

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

Boofo 02-09-2004 12:42 AM

db error
 
Can someone please tell me what is wrong with the syntax in this line? I keep getting db errors from it.


PHP Code:

 $+++++sult $DB_site->query("SELECT user.* FROM ".TABLE_PREFIX."user AS user WHERE userid IN (".implode(", ",$+++++adids).")"); 


g-force2k2 02-09-2004 02:22 AM

I don't think that the character '+' is a valid character in variable names.

Cheers,
g-force2k2

Boofo 02-09-2004 02:26 AM

The word that is bleeped out is W H O R E for who read the thread. ;)

g-force2k2 02-09-2004 02:33 AM

lol, okay, but then I don't believe it is that line that is causing the error, because I tested it and it worked fine, do you have any conflicting lines above or below that could be causing the issue?

Regards,
g-force2k2

Boofo 02-09-2004 03:31 AM

Got it fixed. It was from the Who viewed this thread hack by Kentaurus and luckily he showed up and fixed it. You're right, it apparently wasn't that line exactly. That line is used in the code addon for his hack that gets the usernames in the html format (like for Admin and Mods and such).

I'm curious, how did you test it if you don't have the hack installed? The reason I'm asking is that it might help me in the future if I run into something like this again. ;)

g-force2k2 02-09-2004 03:46 AM

Quote:

Originally Posted by Boofo
I'm curious, how did you test it if you don't have the hack installed? The reason I'm asking is that it might help me in the future if I run into something like this again. ;)

I just added that line of code to a php file of vb3 and its a common query that just selects user columns based upon a particular criteria, at first it required an array to implode so I made one quick, but other then that the query caused no php errors so therefore it couldn't have been that line. php is php works the same in the same conditions, therefore if it doesn't error for me it shouldn't error for you :)

Don't know if I made much sense, but hope that explained it somewhat.

For isntance if you placed:

PHP Code:

$userstuff $DB_site->query "
        SELECT u.username, u.userid,
            p.postid
        FROM " 
TABLE_PREFIX "user u
        LEFT JOIN " 
TABLE_PREFIX "post p USING (userid)
        WHERE postid IN ( 1,2,3,4,5,6,7,8,9,10 )
    " 
) ; 

In one of your scripts it could be said that it works or doesn't work based upon the kind of error you get, besides I do believe that php errors are returned before mysql ones, so even if you got mysql errors you could say the php is fine.

Cheers,
g-force2k2

MindTrix 02-09-2004 05:15 AM

I use Zend for testing errors, i know some people got issues with it but it points out mistakes like a dream

Boofo 02-09-2004 06:09 AM

At a hefty cost it does. ;)


All times are GMT. The time now is 03:20 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.01032 seconds
  • Memory Usage 1,730KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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