Question:
Warning: functionname() expects parameter X to be a type
Calling a function (most commonly a database function such as [FPHP]mysql_fetch_assoc[/FPHP]) results in warning error.
Cause: Input of unexpected type.
Solution:
mysql_fetch_assoc
(PHP 4> = 4.0.3, PHP 5)
mysql_fetch_assoc - Get a MySQL result line from an associative array
Description
mysql_fetch_assoc (resource $ result): array
mysql_fetch_assoc () returns an associative array which contains the line read in the result result and moves the internal data pointer. mysql_fetch_assoc () is equivalent to calling the mysql_fetch_array () function with MYSQL_ASSOC as the second parameter. This function only returns an associative array.
If this is a database function, check the solution listed in #3. Your previous database function is returning FALSE, which indicates a problem in that function.
If it’s not a database function, check the input you are giving to the function for it’s type. [FPHP]var_dump[/FPHP] the variable if necessary, as it will display the type.
if you want to improve the solution
comment to help the community
Post a Comment