I guys
I'm totally clueless about the error I'm getting (Fatal error: [] operator not supported for strings ).
Look at the last line :
Any idea?
I'm totally clueless about the error I'm getting (Fatal error: [] operator not supported for strings ).
Look at the last line :
Code:
$query_result = mysql_query($query_string, $_db_connect) or die (hd_mysql_alert(mysql_error(), $query_string, $ext_lang));
$mysql_num = mysql_affected_rows();
if(strstr($action, "SELECT")) {
$i = 0;
$mysql_num = mysql_num_rows($query_result);
// - ! - loop through colums/fields
while ($i < mysql_num_fields($query_result)) {
$field_result_array[] = mysql_field_name($query_result, $i);
$i++;
}
// - ! - loop through rows
while ($row = mysql_fetch_array($query_result)) {
// - ! - loop through colums/fields
foreach ($field_result_array as $field_name) {
// - ! - if result gives one row
if ($mysql_num == 1) {
// - ! - store into post
if ($template == "POST") {
$_POST[$field_prefix . $field_name] = $row[$field_name];
// - ! - store into global
} else {
$GLOBALS[$field_prefix . $field_name] = $row[$field_name];
}
// - ! - if result gives more than one row
} else if ($mysql_num > 1) {
// !!!!!!! this line gives the error !!!!!!!!
$GLOBALS[$field_prefix . $field_name][] = $row[$field_name];
}
}
}
}
Any idea?