This seemed simply but i’m running into a problem. I’m building an autocomplete drop down box using jquery ui. It works fine with static information but when i try put dynamic data from mysql in the array it freaks out.
Parse error: syntax error, unexpected T_DO, expecting ‘)’ on line 46
Line 46 is the do in the array
$items = array(do {
$row_Recordset1['ARTIST'];
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); );
I’ve searched the net but I can’t find anything relating to problems with a do in an array.
Sorry if this is really stupid but I can’t seem to get it to work
Thanks
You can’t execute code inside an array statement. Please read the manual for the array method. It excepts values , not code.
You should initialise your array , and then use your do/while loop to populate data.