Need script help to update mysql from array
Posted on 2007-04-01
Ok, in way over my head...
I have an array coming in like this:
 => <start_snip>,Samsung A670 (Camera Phone),Verizon Wireless,$0.00,$20.00,+$20.00,<end_snip>
 => <start_snip>,Audiovox PC5740 EV-DO PC Card,Verizon Wireless,$0.00,$30.00,+$30.00,<end_snip>
 => <start_snip>,Novatel V620 EV-DO PC Card,Verizon Wireless,$0.00,$0.00,Free,<end_snip>
I'm connected to the database:
mysql_select_db(labelers) or die("Unable to load update into mysql");
//now I need help to
//select row where 'name' = $data (the info in the second column above) and 'carrier' = $data
//update 'pricetoday' with $data, 'rebates' with $data , 'afterrebates' with $data
//the names in quotes are the field names, the table name is 'cellphones'. I don't know if I need to explode the current array into more arrays or if it's used as is. I am using php4.3.3.
Thank you for any assistance! Chris