Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 09 Sep 2007, 00:33
subnet_rx subnet_rx is offline
 
Join Date: Mar 2005
query_read error?

I'm using this code

$outcomes = $db->query_read("SELECT SUM(outcomes) FROM picks_groups");

And getting this error:
Fatal error: Call to a member function query_read() on a non-object

Can I not use SUM with query_read?
Reply With Quote
  #2  
Old 09 Sep 2007, 00:40
Cole2026 Cole2026 is offline
 
Join Date: Feb 2004
Real name: Cole
Try either

a. Putting the code global $db; before you use it.
b. Use $vbulletin->db instead of $db.
Reply With Quote
  #3  
Old 09 Sep 2007, 01:05
subnet_rx subnet_rx is offline
 
Join Date: Mar 2005
Didn't work, I'm using this function several times in this script and it hasn't given me any problems till now.

EDIT: Never mind, I put global $db in the actual function and I no longer get the error. I no longer get any output either, but that could be due to some logic problem. Thanks.

Last edited by subnet_rx; 09 Sep 2007 at 01:10. Reason: Automerged Doublepost
Reply With Quote
  #4  
Old 09 Sep 2007, 10:06
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Chage query_read() to query_first().
__________________
Marco van Herwaarden
Ex vBulletin.org Coordinator
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 20:33.

Layout Options | Width: Wide Color: