I have this code
$sql5 = "SELECT * FROM iptable
WHERE user_id = '$userid_c' AND ip = '$ip' LIMIT 0, 30 ";
$query5=mysql_query($sql5);
$row_ip_a = mysql_num_rows($query5);
When I use this from phpmyadmin it returns fine results but when I use it from php it always returns one row.
What could be the reason?
mysql_num_rows — Get number of rows in result
U need this:
mysql_fetch_array — Fetch a result row as an associative array, a numeric array, or both
Your Code Just Yields with number of rows affected,
where as u need the data from select query
hence You can use mysql_fetch_array as: