Jump to content


Photo

Or Mysql problem


  • Please log in to reply
1 reply to this topic

#1 Time

Time
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 09 August 2006 - 02:10 PM

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:

$count = mysql_num_rows(mysql_query("SELECT * FROM `mail` WHERE (`ID` = '1' AND `to_id` = '2') OR (`ID` = '1' AND `from_id` = '3')"));


#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 09 August 2006 - 02:12 PM

SELECT count(*) FROM bla bla bla rest of query





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users