#1
  1. Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    49
    Rep Power
    15
    hi,

    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,

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

    Join Date
    Oct 1999
    Location
    Annapolis, Maryland US
    Posts
    113
    Rep Power
    16
    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, 07:18 PM
  2. Replies: 2
    Last Post: January 7th, 2003, 10:41 AM
  3. How to update a query in memebers area?
    By micro in forum PHP Development
    Replies: 35
    Last Post: January 20th, 2002, 02:08 PM
  4. SQL update query problem
    By Rigo in forum PHP Development
    Replies: 21
    Last Post: February 18th, 2001, 01:49 PM
  5. UPDATE query - the ' problem
    By normie in forum PHP Development
    Replies: 1
    Last Post: February 6th, 2001, 02:50 AM

IMN logo majestic logo threadwatch logo seochat tools logo