i have this function that brings me back a value by query a table in the database!
the 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;
}
but its giving me an error saying:
Warning: mysql_num_rows() expects parameter 1 to be resource
i just want the function to either give me a zero or a number 1!
0 for exists and 1 for deosnt exist!