gordo2dope Posted February 26, 2008 Share Posted February 26, 2008 ok, I have a problem here. I have a page that i got help from on here. well it works, but for SOME reason .... if you have it update all 33 fields, it changes EVERYTHING in the table with the same information. If i delete half the fields to UPDATE, it works fine, or if i delete the other half of the insert fields to UPDATE it also works fine. So why wont it work with ALL the fields to update. Here is the code with ALL .... <?php mysql_query("UPDATE mczippo1 SET Part2='" . $part_2nd . "', Description='" . $part_stripdesc . "', OnHand='" . $part_onhand . "', Avail='" . $part_avail . "', OO='" . $part_oo . "', Cost='" . $part_cost . "', Retail='" . $part_retail . "', Sale='" . $part_sale . "', Active='" . $part_active . "', Dept='motorclothes', Comments='" . $part_comments . "', Style='" . $part_style . "', Theme='" . $part_theme . "', Cat1='" . $part_cat1 . "', Cat2='" . $part_cat2 . "', Closeout='" . $part_closeout . "', OrderOnly='" . $part_orderonly . "', Core='" . $part_core . "', OBS='" . $part_obs . "', Aftermarket='" . $part_aftermarket . "', MinQty='" . $part_minqty . "', Picture='" . $part_picture . "', Detail='" . $part_stripdetail . "', Size='" . $part_size . "', SizeID='" . $part_sizeid . "', Gender='" . $part_gender . "', Sleeves='" . $part_sleeves . "', Backprint='" . $part_backprint . "', Color='" . $part_color . "', Pocket='" . $part_pocket . "', Weight='" . $part_weight . "', SetupDate='" . date("Y/m/d") . "'") or die(mysql_error()); ?> NOW, if i delete the first half of the UPDATE fields it works fine. SAMPLE CODE BELOW <?php mysql_query("UPDATE mczippo1 SET Dept='motorclothes', Comments='" . $part_comments . "', Style='" . $part_style . "', Theme='" . $part_theme . "', Cat1='" . $part_cat1 . "', Cat2='" . $part_cat2 . "', Closeout='" . $part_closeout . "', OrderOnly='" . $part_orderonly . "', Core='" . $part_core . "', OBS='" . $part_obs . "', Aftermarket='" . $part_aftermarket . "', MinQty='" . $part_minqty . "', Picture='" . $part_picture . "', Detail='" . $part_stripdetail . "', Size='" . $part_size . "', SizeID='" . $part_sizeid . "', Gender='" . $part_gender . "', Sleeves='" . $part_sleeves . "', Backprint='" . $part_backprint . "', Color='" . $part_color . "', Pocket='" . $part_pocket . "', Weight='" . $part_weight . "', SetupDate='" . date("Y/m/d") . "'") or die(mysql_error()); ?> ALSO, if i just use the FIRST half of the UPDATe, it works.. <?php mysql_query("UPDATE mczippo1 SET Part2='" . $part_2nd . "', Description='" . $part_stripdesc . "', OnHand='" . $part_onhand . "', Avail='" . $part_avail . "', OO='" . $part_oo . "', Cost='" . $part_cost . "', Retail='" . $part_retail . "', Sale='" . $part_sale . "', Active='" . $part_active . "'") or die(mysql_error()); ?> I have to go right now, but ill be back to explain more if theres any questions as to what the problem is here. here is a picture showing what happens. AGAIN, this works PERFECTLY if i only use 1 half of the line at a time... never all 33 fields... Quote Link to comment Share on other sites More sharing options...
tinker Posted February 26, 2008 Share Posted February 26, 2008 There's no WHERE statement so it will update all... I'm not sure what you expect to happen, because it looks like it's doing what was expected? Quote Link to comment Share on other sites More sharing options...
gordo2dope Posted February 27, 2008 Author Share Posted February 27, 2008 OMG, what a dum **** I am, jeez. Just goes to show sometime you need a fresh set of eyes to look at things. Ive been doing this little project for a couple days straight and keep changing things, adding, and taking things off. I totally didnt notice that. Damn, THANKS! - G Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.