Re: Again Select then update
| From: | Jen Downey | Date: | Sun, 24 Mar 2002 07:46:36 +0000 |
| Subject: | Re: Again Select then update | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-17864@lists.php.net to get a copy of this message | ||
Hi all again!
As Bill Morrow stated (in a private e-mail) I needed to use SET name =
\"$update\""; instead of SET name = $update";
It has stopped giving the error but it isn't updating the table. Am I doing
something wrong?
line 4 shows print("your name is $name"); The user name is printed to the
browser but it simply will not update the table.
$query = "SELECT name FROM users WHERE uid={$session["uid"]}";
$ret = mysql_query($query);
while(list($name) = mysql_fetch_row($ret))
print ("your name is $name");
$update = "$name";
$query_update["name"] = "UPDATE my_items SET name = $update";
$result = mysql_query($query_update["name"])or die("Error: ".mysql_error());
Thanks again
Jen