num_row manipulation in mysql?

ipimpm

New Member
i have this function that brings me back a value by query a table in the database!the code:\[code\]function recycle_check($recycle_id){ $query = "SELECT recycle_id FROM notes WHERE user_id = '".$_SESSION['user_id']."' and recycle_id ='$recycle_id'"; if(mysql_num_rows($query)== 0) return 0; else return 1;}\[/code\]but its giving me an error saying:\[code\]Warning: mysql_num_rows() expects parameter 1 to be resource\[/code\]i just want the function to either give me a zero or a number 1!\[code\]0 for exists and 1 for deosnt exist!\[/code\]
 
Back
Top