Hello All! I am having a lil problem when it comes to retrieving data for a specific query. I am working on a pagination class and some reason this query does not wish to work for me. A code snippet $query = "SELECT COUNT(*) FROM $query"; $result = mysqli_query($cxn, $query) or die ("couldnt execute query"); $query_data = mysql_fetch_row($result); $numrows = $query_data[0]; I just want to find the number of rows from the count It gives me this error no matter how I change it -- mysql_fetch_row(): supplied argument is not a valid MySQL result resource in...
Fixed my own problem - This might be helpfull to anyone that is newer-- Make sure your using the correct msql query!! $query = "SELECT COUNT(*) FROM $query"; $result = mysqli_query($cxn, $query) or die ("couldnt execute query"); $query_data = mysqli_fetch_row($result); $numrows = $query_data[0]; I just want to find the number of rows from the count It gives me this error no matter how I change it --