|
-
Mar 9th, 2003, 05:42 AM
#1
Thread Starter
Member
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?
-
Mar 9th, 2003, 09:12 AM
#2
Conquistador
$result = mysql_query($sql, $conn);
?
Try specifying a database.
You'll need to post more of the code if you want us to help...
-
Mar 9th, 2003, 02:20 PM
#3
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|