bouba Posted March 3, 2007 Share Posted March 3, 2007 Hi. I need some help about mysql_fethc_assoc() I am writing a mysql database abstraction set of functions, and I keep getting an error with the abstraction function for mysql_fetch_assoc: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Here is a piece of my code. $dbConn=mysql_connect($dbHost, $dbUser, $dbPass) or die ('Mysql conect failed.'.mysql_error()); mysql_select_db($dbName,$dbConn) or die ('Cannot select database.'.mysql_error()); function dbQuery($sql){ return mysql_query($sql) or die ('Query failed.'.mysql_error()); } function dbAffectedRows(){ global $dbConn; return mysql_affected_rows($sql); } function dbFetchArray($result, $resultType= MYSQL_NUM){ return mysql_fetch_array($result, $resultType); } function dbFetchAssoc($result){ return mysql_fetch_assoc($result); } function dbFetchRow($result){ return mysql_fetch_row($result); } function dbFreeResult($result){ return mysql_free_result($result); } function dbNumRows($result){ return mysql_num_rows($result); } The only function issuing errors is mysql_fetch_assoc(). Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/40970-mysql_fetch_assoc-invalid-argument/ Share on other sites More sharing options...
DanDaBeginner Posted March 3, 2007 Share Posted March 3, 2007 try to check the query.. I guess the error occur in the query.... Quote Link to comment https://forums.phpfreaks.com/topic/40970-mysql_fetch_assoc-invalid-argument/#findComment-198422 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.