phingoc Posted December 4, 2011 Share Posted December 4, 2011 Warning: mysql_num_rows() expects parameter 1 to be resource what am i doing wrong? i have checked, double checked and tripple checked everything. include("mysql_connect.php"); $query = "SELECT * FROM prod2011 WHERE dato BETWEEN '$nyfra' AND '$nytil'"; $antall = mysql_num_rows($query); // I get error on this line. echo "Antall linjer i listen: " . $antall; Link to comment https://forums.phpfreaks.com/topic/252461-num_row-error/ Share on other sites More sharing options...
Pikachu2000 Posted December 4, 2011 Share Posted December 4, 2011 The query is never actually executed with mysql_query(). $query = "SELECT * FROM prod2011 WHERE dato BETWEEN '$nyfra' AND '$nytil'"; $result = mysql_query($query); $antall = mysql_num_rows($result); Link to comment https://forums.phpfreaks.com/topic/252461-num_row-error/#findComment-1294384 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.