I suppose the only way we'll know the problem is if you show us the results of:
EXPLAIN `customers` This will show us the table structure so we can give a better answer. On Oct 21, 4:29 am, "vijay kashyap" <[EMAIL PROTECTED]> wrote: > As you have said the query worked fine for past, the problem is surely with > the values, may be it is due to reasons like value may be null , or may be > of difference in data type, so query is ending up with error. > > On Sun, Oct 19, 2008 at 12:16 PM, da404lewzer <[EMAIL PROTECTED]> wrote: > > > I believe the AND's may of been confusing it, try this instead: > > > UPDATE customers SET fname='FIRSTNAME', lname='LASTNAME', addr1='', > > addr2='', city='CITY', state='STATE', zip='ZIP', phone='PHONE', > > email='[EMAIL PROTECTED]', contactm=0, contactp=1, contacte=1 WHERE > > custid=2 > > > On Oct 18, 8:40 pm, Tim Arview <[EMAIL PROTECTED]> wrote: > > > Hi guys. I'm trying to update a MySQL table through PHP. This isn't > > > new to me, so I can't understand why this particular situation is a > > > problem. > > > > Here's the SQL syntax I'm using: > > > > UPDATE customers SET fname='FIRSTNAME' AND lname='LASTNAME' AND > > > addr1='' AND addr2='' AND city='CITY' AND state='STATE' AND zip='ZIP' > > > AND phone='PHONE' AND email='[EMAIL PROTECTED]' AND contactm=0 AND > > > contactp=1 AND contacte=1 WHERE custid=2 > > > > (I kept as many of the original values as I felt comfortable with. > > > Note that "addr1" and "addr2" are blank.) > > > > So, basically what I'm wanting to do is have the option to change the > > > person's name, address, phone, e-mail, and contact preferences > > > (contactm, contactp, contacte). In this particular situation, I was > > > changing "contactm" from 1 to 0. > > > > The problem is that when I go to look at the table after making the > > > update, the "fname" field has been changed...to 0. The contactm > > > remains the same. > > > > As I said, I've done updates in the past, so I'm really not sure why > > > this is acting funny. Any ideas? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "PHP & MySQL" group. To post to this group, send email to [EMAIL PROTECTED] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/phpmysql?hl=en -~----------~----~----~----~------~----~------~--~---
