Jump to content

Archived

This topic is now archived and is closed to further replies.

Time

Or Mysql problem

Recommended Posts

I was wondering how i can count all the rows in a table where the `ID` field equals '1' and the `to_id` field equals '2', or where the `ID` field equals 1 and the `from_id` field equals '3'.

This is what i have but it doesn't work:

[code=php:0]$count = mysql_num_rows(mysql_query("SELECT * FROM `mail` WHERE (`ID` = '1' AND `to_id` = '2') OR (`ID` = '1' AND `from_id` = '3')"));[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.