RE: [PHP] MySQL/PHP Associative Array Insert

From: Date: Sat, 01 Feb 2003 19:06:45 +0000
Subject: RE: [PHP] MySQL/PHP Associative Array Insert
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-133898@lists.php.net to get a copy of this message
Oops, I forgot the double quotes at the end of the example query from the last email. This is how it should be: Example Query: $query = "SELECT * FROM items WHERE '$item[itemID]'"; > -----Original Message----- > From: @ Nilaab [mailto:superbus22@attbi.com] > Sent: Saturday, February 01, 2003 1:00 PM > To: php-general@lists.php.net > Subject: RE: [PHP] MySQL/PHP Associative Array Insert > > > 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 > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#133898) next »