miniBB Support Forums
|
Forums
|
Register
|
Reply
|
Search
|
Statistics
|
Manual
|
miniBB Support Forums
/
Specific
/
Special db_simpleSelect request
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
Paul
CEO
#2
|
Posted: 23 Feb 2007 12:15
db_simpleSelect(0, 'online', '*', 'status', '=', '0', '', '', 'isonline', '=', '1)
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!
Paul
CEO
#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;
miniBB Support Forums
/
Specific
/ Special db_simpleSelect request
↑
Top
Your Reply
Short link for this topic:
?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.
Before posting, make sure your message is compliant with our
forum posting rules
. If not, it may be locked or deleted with no explanation.
News & Announcements
FAQ
How To
Bugs
The Other
Official Addons and Solutions
Custom Tutorials and Modifications
Master Class
Specific
Re-cycled
Suggestions
Testimonials
qwerty
Features
Requirements
Demo
Download
Showcase
Gallery of Arts
Compiler
Premium Extensions
Premium Support
License
Contacts
Fight the automated spam - protect your miniBB-forums,
getting the
Captcha add-on
!