Jump to content

MySQL result type (ASSOC,NUM, BOTH)


Destramic

Recommended Posts

im getting an error:

 

Warning: mysql_fetch_array() [function.mysql-fetch-array]: The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH. in C:\www\library\mysql.class.php on line 353

 

$result_type = "MYSQL_ASSOC";
$row = mysql_fetch_array($result, $result_type)

 

but if i use (below) it works fine...is the constant() function the right way to what im doing?

 

$result_type = "MYSQL_ASSOC";
$row = mysql_fetch_array($result, constant($result_type))

 

thank you

 

Link to comment
https://forums.phpfreaks.com/topic/226158-mysql-result-type-assocnum-both/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.