Re: MySQL/PHP Associative Array Insert

From: Date: Sat, 01 Feb 2003 19:49:51 +0000
Subject: Re: MySQL/PHP Associative Array Insert
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-133902@lists.php.net to get a copy of this message
On Sat, 01 Feb 2003 10:26:10 -0600 mail@redhotsweeps.com (Cditty) wrote: > 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'] try something like that: <other-code ... i.e. connecting and so on> mysql_query("INSERT INTO items SET itemcolumn='".$item['itemID']."'"); or just mysql_query("INSERT INTO items (itemcolumn) VALUES('".$item['itemID']."')"); Regards, -- Thomas Seifert mailto:thomas.seifert@myphorum.de http://www.MyPhorum.de

« previous php.general (#133902) next »