There is a request. Where do I insert the sql COUNT (*) function?

mysql_query("SELECT datacenter.name, datacenter.surname, senderInfo.name_avatar, senderInfo.has_avatar FROM datacenter LEFT JOIN photo AS senderInfo ON datacenter.id = senderInfo.id WHERE datacenter.id_s = '$id_s' AND datacenter.type = '$touch' ") 
  • More in detail would be. the amount of what you need to know for a start? - Vitaly Kustov
  • the number of id - Zow
  • You have 2 tables. Specify. datacenter.id || photo.id? - Vitaly Kustov
  • Vitaly Kustov in general, I need to count how many rows the query returned - Zow
  • datacenter.id is the primary key - Zow

2 answers 2

I understand the number of id is the number of rows found by the query. Then the usual mysql_num_rows (); If you correctly understood the question. Specify details.

    I remembered the anecdote about Lieutenant Rzhevsky, a candlestick about three candles and a fourth candle. I myself wonder what it is for.