Jump to content

mysql_fetch_assoc() invalid argument


bouba

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.