vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Referral Statistics (https://vborg.vbsupport.ru/showthread.php?t=64469)

armani1072 05-15-2004 11:17 PM

Samething. does the table have to be created in the database? thanks for all your help by the way :)


Database error in vBulletin 3.0.1:

Invalid SQL: SELECT COUNT(*) AS referrals, user.username, user.userid FROM precisi_forums.user AS users
LEFT JOIN user ON (users.referrerid = user.userid)
WHERE user.userid > 0
GROUP BY users.referrerid
ORDER BY referrals DESC
LIMIT 10
mysql error: Table 'precisi_forums.user' doesn't exist

mysql error number: 1146

Boofo 05-16-2004 12:25 AM

Quote:

Originally Posted by armani1072
Samething. does the table have to be created in the database? thanks for all your help by the way :)


Database error in vBulletin 3.0.1:

Invalid SQL: SELECT COUNT(*) AS referrals, user.username, user.userid FROM precisi_forums.user AS users
LEFT JOIN user ON (users.referrerid = user.userid)
WHERE user.userid > 0
GROUP BY users.referrerid
ORDER BY referrals DESC
LIMIT 10
mysql error: Table 'precisi_forums.user' doesn't exist

mysql error number: 1146

Very simple fix. In the referals.php file

Find:

PHP Code:

$referrers $DB_site->query("SELECT COUNT(*) AS referrals, user.username, user.userid FROM user AS users 
                   LEFT JOIN user ON (users.referrerid = user.userid) 
                   WHERE user.userid > 0
                   GROUP BY users.referrerid 
                   ORDER BY referrals DESC 
                   LIMIT 
$max"); 

REPLACE it with:

PHP Code:

$referrers $DB_site->query("SELECT COUNT(*) AS referrals, user.username, user.userid FROM user AS users 
                   LEFT JOIN user AS user ON (users.referrerid = user.userid) 
                   WHERE user.userid > 0
                   GROUP BY users.referrerid 
                   ORDER BY referrals DESC 
                   LIMIT 
$max"); 


armani1072 05-16-2004 12:37 AM

Umm you want me to replace the code i find with the same code? still got the error. sorry to be a bother.

Database error in vBulletin 3.0.1:

Invalid SQL: SELECT COUNT(*) AS referrals, user.username, user.userid FROM user AS users
LEFT JOIN user AS user ON (users.referrerid = user.userid)
WHERE user.userid > 0
GROUP BY users.referrerid
ORDER BY referrals DESC
LIMIT 10
mysql error: Table 'precisi_forums.user' doesn't exist

mysql error number: 1146

Boofo 05-16-2004 12:44 AM

Quote:

Originally Posted by armani1072
Umm you want me to replace the code i find with the same code? still got the error. sorry to be a bother.



Database error in vBulletin 3.0.1:

Invalid SQL: SELECT COUNT(*) AS referrals, user.username, user.userid FROM user AS users
LEFT JOIN user AS user ON (users.referrerid = user.userid)
WHERE user.userid > 0
GROUP BY users.referrerid
ORDER BY referrals DESC
LIMIT 10
mysql error: Table 'precisi_forums.user' doesn't exist

mysql error number: 1146

I changed the second line in the query to user AS user ON. Anytime there is a table prefix being used, all tables must must delared like that in a query if you are accessing more than one table in the query.

armani1072 05-16-2004 01:29 AM

same error message as post #73

gspot 05-16-2004 06:01 AM

TRY THIS:

PHP Code:

$referrers $DB_site->query("SELECT COUNT(*) AS referrals, user.username, user.userid FROM precisi_forums.user AS users 
                   LEFT JOIN user ON (users.referrerid = user.userid) 
                   WHERE user.userid > 0
                   GROUP BY users.referrerid 
                   ORDER BY referrals DESC 
                   LIMIT 
$max"); 

AND THEN CHANGE THE OTHER QUERY TO:

PHP Code:

$referreds $DB_site->query("SELECT username FROM precisi_forums.user WHERE referrerid = '$referrer[userid]' AND referrerid > 0"); 

Once those changes are made, that should work.. Just let me know. :)

gspot 05-17-2004 03:35 AM

Did this work for u?? :speechless:

armani1072 05-17-2004 08:21 PM

Samething. I think i am doing something wrong here. it cannot be that difficult. also everytime i have to run queries for any hack it gives me an error. I am in the middle of building vB3.01 for an upgrade from vB2.3.4 so it is just in a test directory. Could this be causing my problems? I did set up a new database to run the test dir. ugh this bites. Thanks for all the help.

Database error in vBulletin 3.0.1:

Invalid SQL: SELECT COUNT(*) AS referrals, user.username, user.userid FROM precisi_forums.user AS users
LEFT JOIN user ON (users.referrerid = user.userid)
WHERE user.userid > 0
GROUP BY users.referrerid
ORDER BY referrals DESC
LIMIT 10
mysql error: Table 'precisi_forums.user' doesn't exist

mysql error number: 1146

Boofo 05-17-2004 08:24 PM

Quote:

Originally Posted by gspot
Did this work for u?? :speechless:

What about the LEFT JOIN table? ;)

gspot 05-18-2004 03:52 PM

Did you make this test site for vbulletin with a table prefix?? If so, please post the prefix that you used for the installation of vbulletins sql tables.. This will help me eliminate the problem you are having.


All times are GMT. The time now is 01:06 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.01558 seconds
  • Memory Usage 1,754KB
  • 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
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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