Results 1 to 3 of 3

Thread: mysql update problem

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2001
    Posts
    56

    mysql update problem

    Hi,

    I am trying to edit my sql database as follows

    PHP Code:
    $sql "UPDATE clients SET Name='$Name' WHERE PrimaryKey=$clientid";
    $result mysql_query($sql); 
    my database is connected to, the table i wish to edit is called clients. the field i wish to update is called Name with a varible called $Name.

    However, i get a parse error.

    What's wrong?

  2. #2
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    $result = mysql_query($sql, $conn);

    ?

    Try specifying a database.

    You'll need to post more of the code if you want us to help...

  3. #3
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337

    Re: mysql update problem

    Originally posted by Rickead2000
    Hi,

    I am trying to edit my sql database as follows

    PHP Code:
    $sql "UPDATE clients SET Name='$Name' WHERE PrimaryKey=$clientid";
    $result mysql_query($sql); 
    my database is connected to, the table i wish to edit is called clients. the field i wish to update is called Name with a varible called $Name.

    However, i get a parse error.

    What's wrong?
    your parse error is the last variable. put single quotes around it
    PrimaryKey='$clientid'

    but wha tline did it say it had a error on?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width