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)
-   -   List latest X paid subscribers on Forum Home (https://vborg.vbsupport.ru/showthread.php?t=65254)

assassingod 07-04-2004 02:33 PM

Quote:

Originally Posted by tamarian
Ah, yes. Thanks for the catch!

No problem:)

Cold Steel 07-04-2004 06:46 PM

Thanks assassingod and tamarian.

This is my code:

Code:

// ###################### thankyou #######################
function thankyou(){
global $DB_site, $stylevar, $vboptions, $vbphrase;
 
require_once('./global.php');
 
$latestcontributers = $DB_site->query("SELECT username, status, regdate, subscriptionlog.userid
FROM " . TABLE_PREFIX . "subscriptionlog AS subscriptionlog
LEFT JOIN " . TABLE_PREFIX . "user AS user
USING ( userid )
WHERE user.userid = subscriptionlog.userid
AND STATUS = '1'
ORDER BY regdate DESC
LIMIT 5");
 
$latest_str = "";
while ($contributer = $DB_site->fetch_array($latestcontributers))
{
eval ('$latest_str .= ", ' . fetch_template('thanksbit') . '";');
}
$latest_str = substr($latest_str , 2);
$latest_str = addslashes($latest_str);
$DB_site->query("UPDATE " . TABLE_PREFIX . "template SET template=\"$latest_str\", template_un=\"$latest_str\" WHERE title='thanks'");
}

And this is my error:

Quote:

Warning: Invalid argument supplied for foreach() in /home/asiansin/public_html/forums/global.php on line 645

Warning: Invalid argument supplied for foreach() in /home/asiansin/public_html/forums/includes/functions.php on line 2895

Warning: Invalid argument supplied for foreach() in /home/asiansin/public_html/forums/includes/functions.php on line 2895

Warning: Invalid argument supplied for foreach() in /home/asiansin/public_html/forums/includes/functions.php on line 2895

Database error in vBulletin 3.0.1:

Invalid SQL: SELECT username, status, regdate, subscriptionlog.userid
FROM subscriptionlog AS subscriptionlog
LEFT JOIN user AS user
USING ( userid )
WHERE user.userid = subscriptionlog.userid
AND STATUS = '1'
ORDER BY regdate DESC
LIMIT 5
mysql error: Column: 'status' in field list is ambiguous

mysql error number: 1052

Date: Sunday 04th of July 2004 02:44:37 PM
Script: http://forums.asiansinc.com/admincp/subscriptions.php
Referer: http://forums.asiansinc.com/admincp/...iptionlogid=12
Username: Webmaster
IP Address:

tamarian 07-04-2004 06:51 PM

Quote:

Originally Posted by Cold Steel
Thanks assassingod and tamarian.

This is my code:

And this is my error:

O.k., I've made a small change by adding subscriptionlog. prefix, even though it's not ambigious!

Give it another try (just step #2), and let's see how it goes.

Cold Steel 07-04-2004 07:04 PM

Apparently, mysql still can't get it clear:

Quote:

Invalid SQL: SELECT username, status, regdate, subscriptionlog.userid
FROM subscriptionlog AS subscriptionlog
LEFT JOIN user AS user
USING ( userid )
WHERE user.userid = subscriptionlog.userid
AND subscriptionlog.status = '1'
ORDER BY subscriptionlog.regdate DESC
LIMIT 5
mysql error: Column: 'status' in field list is ambiguous

tamarian 07-04-2004 07:24 PM

Quote:

Originally Posted by Cold Steel
Apparently, mysql still can't get it clear:

Let's try this:

PHP Code:

   // ###################### thankyou #######################
      
function thankyou(){
            global 
$DB_site,  $stylevar$vboptions$vbphrase;
      
          require_once(
'./global.php');
      
          
$latestcontributers $DB_site->query("SELECT *
                     FROM " 
TABLE_PREFIX "subscriptionlog AS subscriptionlog
                     LEFT JOIN " 
TABLE_PREFIX "user AS user
                     USING ( userid )
                     WHERE user.userid = subscriptionlog.userid
                 AND subscriptionlog.status = '1'
                     ORDER BY subscriptionlog.regdate DESC
                     LIMIT 5"
);
      
          
$latest_str "";
          while (
$contributer $DB_site->fetch_array($latestcontributers))
          {
             eval (
'$latest_str .= ", ' fetch_template('thanksbit') . '";');
          }
          
$latest_str substr($latest_str 2);
          
$latest_str addslashes($latest_str);
 
$DB_site->query("UPDATE " TABLE_PREFIX "template SET template=\"$latest_str\", template_un=\"$latest_str\" WHERE title='thanks'");
      } 


Cold Steel 07-04-2004 07:36 PM

That worked. Thanks a ton!

BTW I'm a big anti-carb person myself. :)

tamarian 07-04-2004 07:52 PM

Quote:

Originally Posted by Cold Steel
That worked. Thanks a ton!

That's great to hear. I'm just curious, what versions of PHP and MySQL do you run?

Cold Steel 07-04-2004 09:32 PM

PHP v4.3.3
MySQL v4.0.18-standard

RapCheck 07-20-2004 07:53 PM

I'm getting these errors when editing subscription users


Quote:

Warning: Invalid argument supplied for foreach() in /home/sites/site8/web/b/includes/functions.php on line 2878

Warning: Invalid argument supplied for foreach() in /home/sites/site8/web/b/includes/functions.php on line 2878

Warning: Invalid argument supplied for foreach() in /home/sites/site8/web/b/includes/functions.php on line 2878
I see others have had similar, though I have no mySQL error with it, and the everything seems to work fine updating the subscription. I don't have the store hack or cash hack installed...

I'd just like to know what it means, and if it'll affect anything on my board or subscriptions.

nice hack though, btw.

Bryan Ex 07-20-2004 08:20 PM

Did you edit functions.php with dreamweaver by chance? If so it's one of a couple of vB3 files it will mess up by changing code on you.


All times are GMT. The time now is 09:50 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.01191 seconds
  • Memory Usage 1,759KB
  • 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
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (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