Re: [PHP-DB] Re: Again Select then update

2002-03-24 Thread Bill Morrow

On Sat, Mar 23, 2002 at 11:46:36PM -0800, Jen Downey wrote:
 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());
 

Is this your latest code? You still don't have quotes around $update, if so.

Nothing returned in the .mysql_error()?

Can you run the query by hand?

Bill

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Re: Again Select then update

2002-03-24 Thread Jen Downey

Hi Bill,

No it isn't the latest it is updated with the quotes  and slashes in the
script.
I have found that even if I put my name Jen as $update it still wont update
the table.

$update = Jen

There is no error and the script acts like it work fine without updating.
I just did a test.php script and ran it. It will print the user name but
still wont update the table.

This has me totally stumped.

Thanks
Jen


Bill Morrow [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Sat, Mar 23, 2002 at 11:46:36PM -0800, Jen Downey wrote:
  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());
 

 Is this your latest code? You still don't have quotes around $update, if
so.

 Nothing returned in the .mysql_error()?

 Can you run the query by hand?

 Bill



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php