Dear all, the following PHP script produces the warnings Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in fetchArray function Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in releaseQuery function is there a way to tell these function that we are passing a resource for them? thanks, balto function connectMydb(){ $link=mysql_connect('localhost', 'mydb', 'pass') or die ('could not connect to Database'); mysql_select_db("mydbases"); return $link; } //--------------------------------- Query ------------------------------------ function queryMydb($stmt){ return mysql_query ($stmt) or die (mysql_error()); } //------------------------------- Release Query --------------------------- function releaseQuery($query){ mysql_free_result ($query); } //----------------------------- fetch a row --------------------------------- function fetchArray ($query){ return mysql_fetch_array($query, MYSQL_ASSOC); } $link = connectMydb(); $result=queryMydb("select * from mytable"); $row=fetchArray($result); //.... do something with data.