On Fri, 21 May 2004, Edward Peloke wrote:
>
> $sql=new Database();
> $sql->query("select fname,lname, id from clients");
> $clients[]=array();
> while($sql->nextRecord()){
> array_push($clients, $sql->getField('id')=>$sql->getField('fname'));
> } // while
>
> Parse error: parse error, unexpected T_DOUBLE_ARROW in
> C:\obox\Apache2\htdocs\nh_vacdest\admin\test.php on line 38
>
If you want to do it the way you're doing now you should do ik like this:
array_push($clients, array($sql->getField('id')=>$sql->getField('fname')));
Another possible solution is like this:
$clients[$sql->getField('id')] = $sql->getField('fname');
--
Jeroen
There are only two kinds of programming languages: those people always bitch about and
those nobody uses.
-- Bjarne Stroustrup
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php