ALMOST THERE!!!!
I added $XML_IDList[] = $temp[21]; into my parsing loop to get the values for the $XML_IDList to become more then just the last number in the array. it now contains all numbers in the sheet.
Now this almost works
Code: Select all
while($row = mysql_fetch_row($idrs))
$DB_IDList[] = $row[0];
$Update_Query = "UPDATE CB_rateplan SET <1> WHERE productid=<2>";
//match and update/add as needed... trifle now
foreach($XML_IDList as $p_id) {
print "p_id; ".$p_id. "<BR>";
if(in_array($p_id, $DB_IDList)) {
foreach($column as $i=>$col) {
if($i != 21){ //avoid id field
$updlist[] = "$col='$temp[$i]'";
}//if 3
}//foreach 2
$update_rp = str_replace(array('<1>', '<2>'), array(join(', ', $updlist), $p_id), $Update_Query);
echo $update_rp. "<BR><BR>";
}else { //if 2
$add_rp = "INSERT INTO CB_rateplan $rows VALUES $values ;";
echo $add_rp;
//mysql_query($add_rp);
} //if 2continued
}//foreach one
now the problem is that with every Prod_id the Update statement just dublicates with the same value
p_id; 53037
UPDATE CB_rateplan SET planname='America\'s Choice with Push to Talk Family Share 6000 (Includes 2 Lines)', planminutes='6000', monthlyaccessfee='319.9900', additionalairtimefee='0.2000', activationfee='20.0000', roamfee='0', roamingfee='$0.00/min - no roaming charges', contractmonth='24', cancellationfee='$175.00', peakrate='', offpeakrate='', includedairtimeoffpeak='50000', includedairtimepeak='', nightweekendminutes='unlimited night & weekend minutes', extraminutes='', longdistancerate='0', longdistanceratestring='$0.00 (included)', nationalplanind='', peakhours='', offpeakhours='9:01pm - 5:59am monday - friday; 2:00am saturday - 11:59pm sunday', offpeakdays='', productid='54278', carrierdescription='verizon wireless', imagefilelocation='images/carriers/', imagefilename='verizonlogo.gif', sharedplan='true', rateplanid='14377' WHERE productid=53037
p_id; 53103
UPDATE CB_rateplan SET planname='America\'s Choice with Push to Talk Family Share 6000 (Includes 2 Lines)', planminutes='6000', monthlyaccessfee='319.9900', additionalairtimefee='0.2000', activationfee='20.0000', roamfee='0', roamingfee='$0.00/min - no roaming charges', contractmonth='24', cancellationfee='$175.00', peakrate='', offpeakrate='', includedairtimeoffpeak='50000', includedairtimepeak='', nightweekendminutes='unlimited night & weekend minutes', extraminutes='', longdistancerate='0', longdistanceratestring='$0.00 (included)', nationalplanind='', peakhours='', offpeakhours='9:01pm - 5:59am monday - friday; 2:00am saturday - 11:59pm sunday', offpeakdays='', productid='54278', carrierdescription='verizon wireless', imagefilelocation='images/carriers/', imagefilename='verizonlogo.gif', sharedplan='true', rateplanid='14377', planname='America\'s Choice with Push to Talk Family Share 6000 (Includes 2 Lines)', planminutes='6000', monthlyaccessfee='319.9900', additionalairtimefee='0.2000', activationfee='20.0000', roamfee='0', roamingfee='$0.00/min - no roaming charges', contractmonth='24', cancellationfee='$175.00', peakrate='', offpeakrate='', includedairtimeoffpeak='50000', includedairtimepeak='', nightweekendminutes='unlimited night & weekend minutes', extraminutes='', longdistancerate='0', longdistanceratestring='$0.00 (included)', nationalplanind='', peakhours='', offpeakhours='9:01pm - 5:59am monday - friday; 2:00am saturday - 11:59pm sunday', offpeakdays='', productid='54278', carrierdescription='verizon wireless', imagefilelocation='images/carriers/', imagefilename='verizonlogo.gif', sharedplan='true', rateplanid='14377' WHERE productid=53103
And bigger and bigger and bigger
What needs to happen been trying stuff for hours with no success. All i can see is that productid in the value array is only equating to the last in the array again and not matching to the call.
AAARGGGGGGGGG![/b]