Подскажите, пожалуйста, как эти два запроса преобразовать в один ?
Код:
$arr_t = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS cnt FROM users WHERE userid=$userid"));
$arr_s = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS cnt2 FROM users WHERE userid=$userid AND isreader='yes'"));
$first = $arr_t["cnt"];
$second = $arr_s["cnt2"];
Код:
$arr_t = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS cnt FROM users WHERE userid=$userid"));
$arr_s = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS cnt2 FROM users WHERE userid=$userid AND isreader='yes'"));
$first = $arr_t["cnt"];
$second = $arr_s["cnt2"];