Whats the best way to update...
| From: | Jas | Date: | Thu, 01 Aug 2002 19:56:11 +0000 |
| Subject: | Whats the best way to update... | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-20959@lists.php.net to get a copy of this message | ||
I need to know the best way to update a record based on something like the
session id being the same, except the other fields are not. Any examples of
this would help...
$table = "cm_sessions";
$sql_insert_form = "INSERT INTO $table
(session,ipaddy,host,referrer,hck,nrml,hour,date_stamp) VALUES
('$holy_cow','$ipaddy','$host','$domain_b','$hck','-','$hour','$date')";
$result = @mysql_query($sql_insert_form,$dbh) or die(MYSQL_ERROR());
or
$sql_insert = "UPDATE $table WHERE session =
"$HTTP_SESSION_VARS['session']"
or if the session vars are the same it would insert a new row? I hope I am
asking the question correctly. Any help, examples would be great!
TIA
Jas