-
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?
-
$result = mysql_query($sql, $conn);
?
Try specifying a database.
You'll need to post more of the code if you want us to help...
-
Re: mysql update problem
Quote:
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?