miniBB ®

miniBB

®
Support Forums
  
 · Start · Sign in · Register · Search · Statistics · File Bank · Manual ·
Specific miniBB Support Forums / Specific /  
 

Special db_simpleSelect request

 
Author Anonymous
Guest
#1 · Posted: 23 Feb 2007 12:01Reply Quote
Hi guys!
I have a question and I hope someone can help me...

How do i format the following mysql query with the db_simpleSelect function:

SELECT * FROM online WHERE status = '0' && isonline = '1'

I've seen several examples with the db_simpleSelect but i just can't seem to figure it out for the above and it's giving me a headache...

Can anyone help me please?

Thanks in advance

DJ

Author Paul
Lead Lead Developer
#2 · Posted: 23 Feb 2007 12:15Reply Quote
db_simpleSelect(0, 'online', '*', 'status', '=', '0', '', '', 'isonline', '=', '1)

Author Anonymous
Guest
#3 · Posted: 23 Feb 2007 12:41Reply Quote
Hi Paul,
thanks for the speedy reply!

However i think i made a mistake with my question...
I have the following query:

$guests_online = mysql_query("SELECT * FROM online WHERE status = '0' && isonline = '1'");
$guests_online_number = mysql_num_rows($guests_online);


...and i'm trying to receive the $guests_online_number with the db_simpleSelect (so eventually it will display a number).

So with the above you gave me, where should i place the 'count' for counting the number of rows in the mysql 'online' table?

Thanks again!

Author Paul
Lead Lead Developer
#4 · Posted: 26 Feb 2007 04:03Reply Quote
$row=db_simpleSelect(0, 'online', 'count(*)', 'status', '=', '0', '', '', 'isonline', '=', '1);
$guests_online_number = $row[0];

or

db_simpleSelect(0, 'online', '*', 'status', '=', '0', '', '', 'isonline', '=', '1);
$guests_online_number = $countRes;

Specific miniBB Support Forums / Specific /
 Special db_simpleSelect request
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message

BB code for the Bold StyleBB code for the Italic StyleBB Code for the PictureBB code for the URLUpload a File

  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Check out the File and Picture Attachments add-on: extend your miniBB-forums, attaching images and files.