miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Specific miniBB Support Forums / Specific /  
 

Special db_simpleSelect request

 
Author Anonymous
Guest
#1 | Posted: 23 Feb 2007 12:01 
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 Developer 
#2 | Posted: 23 Feb 2007 12:15 
db_simpleSelect(0, 'online', '*', 'status', '=', '0', '', '', 'isonline', '=', '1)

Author Anonymous
Guest
#3 | Posted: 23 Feb 2007 12:41 
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 Developer 
#4 | Posted: 26 Feb 2007 04:03 
$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


  ?
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
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑