php - 2 Mysql query for number of rows and main query? -
i'm trying find solution have total rows affected of query without "limit" clause , records of query limit clause... how without 2 queries (count(*) , main query?
thanks
edit: here query:
$result = mysqli_query($link,"select distinct p.* posts p join abos on p.userid = a.blogid or p.userid = 11 left join posts_denied r on r.post_id = p.id , r.userid = 11 (a.userid = 11 or p.userid = 11) , r.post_id null order p.id desc limit 5");
try mysql_affected_rows
like
mysql_query($sql_query); echo "number of rows effected = ".mysql_affected_rows();
see link
and try avoid using mysql_*
functions due deprecated.instead use mysqli_*
functions or pdo
statements.
Comments
Post a Comment