1. Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Rep Power

    i'm having a problem with and update query using mysql... the query is:

    "update db1 set name='$name' && email='$email' && address='$address' where ID='$ID'";

    when i take out the "and" and ask mysql to update only one column, it works fine though ;(

    Does anyone know why this is, and if there's a way around it ? Of course i could always make up 3 different queries but i was going to try to make it a bit cleaner ;P

    thanks for any help,

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Annapolis, Maryland US
    Rep Power
    Use a comma

    > update db1
    > SET name='$name',
    > email='$email',
    > address='$address'
    > where id = '$id';

Similar Threads

  1. Query Update Problem
    By InsaneContender in forum MySQL Help
    Replies: 1
    Last Post: December 18th, 2003, 06:18 PM
  2. Replies: 2
    Last Post: January 7th, 2003, 09:41 AM
  3. How to update a query in memebers area?
    By micro in forum PHP Development
    Replies: 35
    Last Post: January 20th, 2002, 01:08 PM
  4. SQL update query problem
    By Rigo in forum PHP Development
    Replies: 21
    Last Post: February 18th, 2001, 12:49 PM
  5. UPDATE query - the ' problem
    By normie in forum PHP Development
    Replies: 1
    Last Post: February 6th, 2001, 01:50 AM

IMN logo majestic logo threadwatch logo seochat tools logo