Dude, you need commas between your array items.
----------------------------------------------------------------------------
Gfunk - [EMAIL PROTECTED] - http://www.gfunk007.com/
----- Original Message -----
From: "Duke" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 12, 2001 12:05 PM
Subject: [PHP] array() stuff
> I'm trying to create the following array:
>
> $host_info = array(
> "hostname" => "localhost"
> "log" => "rocketbox_db.log"
> "username" => $username
> "password" => $password
> "database" => "rocketbox"
> "table" => $table
> );
>
> however when I try and access the document, I get the following error:
>
> Parse error: parse error, expecting `')'' in
> /usr/home/kidlinux/htdocs/rocketbox/admin/index.php on line 26
>
> line 26 is \* "log" => "rocketbox_db.log" *\ in the array code I
> pasted above. This isn't very far into my script, and I'm sure I havn't
> missed anything like a ) in my code anywhere before that array()
> declaration. I've gone over my code several times. According to the
> documentation (or my interpretation of it) that array should be correct.
> One other thing I'm unsure of that doesn't seem to be covered in the
> documentation is referring to variables in an array, like \* "username"
=>
> $username *\ where $username is a variable submitted by an html form
via
> the post method. Should that work?? And what about referring to a
function
> in an array such as the following:
>
> $value = array(
> "date" => $date = strftime('%Y-%m-%d')
> "title" => $info_title
> "dept" => $info_dept
> "info" => $info
> );
>
> Is that valid? Can i just do \* "date" => strftime('%Y-%m-%d') *\ ??
>
> Thanks for your help.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]