RE: [PHP] MySQL/PHP Associative Array Insert
| From: | @ Nilaab | Date: | Sat, 01 Feb 2003 19:00:06 +0000 |
| Subject: | RE: [PHP] MySQL/PHP Associative Array Insert | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133897@lists.php.net to get a copy of this message | ||
Yes Chris,
When you add the item to the database, make sure to leave out the single
quotes inside the brackets of the associative array. For example:
Instead Of:
$item['itemID']
Do This:
$item[itemID]
Example Query:
$query = "SELECT * FROM items WHERE '$item[itemID]';
Hope that helps.
> -----Original Message-----
> From: CDitty [mailto:mail@redhotsweeps.com]
> Sent: Saturday, February 01, 2003 10:26 AM
> To: php-general@lists.php.net
> Subject: [PHP] MySQL/PHP Associative Array Insert
>
>
> A co-worker is teaching me to move to the next level in php. I have
> started using associative arrays for my scripts, but I am having a problem
> using them to do an insert into MySQL. Can someone give me an example of
> how to do an insert to the database using these arrays? My array is
> this...$item['itemID']
>
> Thanks
> Chris
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>