delete statement isn't working... why?
Moderator: General Moderators
-
vincenzobar
- Forum Commoner
- Posts: 95
- Joined: Wed Nov 02, 2005 9:57 am
Warning: array_map(): Argument #2 should be an array in /home/vincenzoba/domains/underwaterdesign.com/public_html/xml/output-rate.php on line 98
Warning: implode(): Bad arguments. in /home/vincenzoba/domains/underwaterdesign.com/public_html/xml/output-rate.php on line 99
('', '')Column count doesn't match value count at row 1
Warning: implode(): Bad arguments. in /home/vincenzoba/domains/underwaterdesign.com/public_html/xml/output-rate.php on line 99
('', '')Column count doesn't match value count at row 1
-
vincenzobar
- Forum Commoner
- Posts: 95
- Joined: Wed Nov 02, 2005 9:57 am
-
vincenzobar
- Forum Commoner
- Posts: 95
- Joined: Wed Nov 02, 2005 9:57 am
-
vincenzobar
- Forum Commoner
- Posts: 95
- Joined: Wed Nov 02, 2005 9:57 am
The error comes when there are duplicate product ID in the table.
so if the datadump XML sheet has say 20 duplicates of P-id 12345 then it dies.
This is good and bad. Good because it shows there is an error in the dump. bad because it fails to continue the rest of the script so if i get a bad dump it could mess up the whole table.
I guess i need to add a check like if row is there more than once then delete all duplicates.
Anyone know how i should go about this?
Anyone know any short cuts for this???
thanks for all your guys/gals(if any here) help!!!
your the greatest!
so if the datadump XML sheet has say 20 duplicates of P-id 12345 then it dies.
This is good and bad. Good because it shows there is an error in the dump. bad because it fails to continue the rest of the script so if i get a bad dump it could mess up the whole table.
I guess i need to add a check like if row is there more than once then delete all duplicates.
Anyone know how i should go about this?
Anyone know any short cuts for this???
thanks for all your guys/gals(if any here) help!!!
your the greatest!
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
-
vincenzobar
- Forum Commoner
- Posts: 95
- Joined: Wed Nov 02, 2005 9:57 am
after much studying of the XML file it turns out that they are not REALLY Duplicates. The only difference is that the "rateplanid" is different.
Howerver this is causing a problem on delete because i am deleteing where productid is the same and for some reason as soon as it hits a duplicate id the array breaks and i get all the warnings above.
is there code that will realize this fact or is there a way to delete where product id match DB and XML Dump for every rateplanid that exists with XML product id.... i know confusing...
here is the output and as you can see it goes to delete something that isn't there... i think how do i get around this. BTW, i tested this script on another file without rateplan and it worked perfectly.
Howerver this is causing a problem on delete because i am deleteing where productid is the same and for some reason as soon as it hits a duplicate id the array breaks and i get all the warnings above.
is there code that will realize this fact or is there a way to delete where product id match DB and XML Dump for every rateplanid that exists with XML product id.... i know confusing...
here is the output and as you can see it goes to delete something that isn't there... i think how do i get around this. BTW, i tested this script on another file without rateplan and it worked perfectly.
DELETE FROM CB_rateplan WHERE productid = 53643;('', '121', 'US Cellular National Plan w/ 1200', '1200', '59.9500', '0.4000', '0', '0', 'included ($0.00/min)', '24', '$150.00', '', '', '0', '', '0', '', '0', 'included ($0.00/min)', '', '', 'monday - friday 9:00pm to 6:59am; weekends friday 9:00pm to monday 6:59am', '', '53639', 'u.s. cellular', 'images/carriers/', 'uscellular_l.gif', 'false', '13821')
DELETE FROM CB_rateplan WHERE productid = 53639;('', '122', 'US Cellular National Plan w/ 2000', '2000', '99.9500', '0.3000', '0', '0', 'included ($0.00/min)', '24', '$150.00', '', '', '0', '', '0', '', '0', 'included ($0.00/min)', '', '', 'monday - friday 9:00pm to 6:59am; weekends friday 9:00pm to monday 6:59am', '', '53641', 'u.s. cellular', 'images/carriers/', 'uscellular_l.gif', 'false', '13857')
DELETE FROM CB_rateplan WHERE productid = 53641;
Warning: array_map(): Argument #2 should be an array in /home/vincenzoba/domains/underwaterdesign.com/public_html/xml/output-rate.php on line 99
Warning: implode(): Bad arguments. in /home/vincenzoba/domains/underwaterdesign.com/public_html/xml/output-rate.php on line 100
('', '')Column count doesn't match value count at row 1
-
vincenzobar
- Forum Commoner
- Posts: 95
- Joined: Wed Nov 02, 2005 9:57 am