Jump to content

UPDATE table - weird problem - 1 half of fields or the other, NEVER ALL ?


gordo2dope

Recommended Posts

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...

 

tableweird.jpg

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.