miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | 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 | Edited by: Paul 
$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 Top

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

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Get the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB