vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   What's wrong.... (https://vborg.vbsupport.ru/showthread.php?t=36879)

Kyomu 04-02-2002 03:28 AM

What's wrong....
 
What's wrong with the following SQL query?
Code:

SELECT forum.*, forumpermission.canpost, forumpermission.canview
                                                FROM forum
                                                LEFT JOIN forum ON forum.forumid=forumpermission.forumid
                                                WHERE forum.displayorder<>0 AND forum.active=1 AND forum.isnews=1 AND forumpermission.usergroupid='$bbuserinfo[usergroupid]'
                                                ORDER BY forum.parentid,forum.displayorder

I get the error:
Code:

Not unique table/alias: 'forum'
My brains are fired... help... =(

Admin 04-02-2002 04:38 AM

You are JOINing the forum table to itself without giving them an alias. That's the error, but in your code LEFT JOIN forum should be LEFT JOIN forumpermission.

Kyomu 04-02-2002 03:16 PM

Quote:

Originally posted by FireFly
You are JOINing the forum table to itself without giving them an alias. That's the error, but in your code LEFT JOIN forum should be LEFT JOIN forumpermission.
Ah, thanks, it works now.
Now I'm getting a parse error here....

Code:

$threads=DB_site->query("SELECT threadid,forumid,dateline FROM thread WHERE $forumids ORDER BY dateline DESC");
Thanks for the help again.

Mark Hensler 04-02-2002 07:08 PM

$threads=$DB_site->

Kyomu 04-02-2002 07:42 PM

Quote:

Originally posted by Mark Hensler
$threads=$DB_site->
Ahh, no wonder I couldn't pick it up... too used to C++...

Thanks.


All times are GMT. The time now is 12:31 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.00924 seconds
  • Memory Usage 1,718KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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