View Single Post
Old 10-12-2011, 06:50 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
This isn't valid syntax:
PHP Code:
$GLOBALS['text']=array (

        while( 
$row sqlsrv_fetch_array$stmt1SQLSRV_FETCH_ASSOC) ) {
                
$term=$row["term"];
                
$native_term=$row["native_term"];

    
$term => $native_term,

}

); 
You need to capture each of these in an array and merge it into the globals. You should also avoid using globals completely as well. There is no need to actually pull $row apart at all, its already an associative array. That can be added or merged to any other existing array. The problem you'll have is that only the last entry provided will win as it will otherwise overwrite. So you need to choose if $text will be a single dimension associative array, or if it will be a multi dimension array.
Fou-Lu is offline   Reply With Quote