02-09-2008, 01:58 AM
|
#12 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
It'll make things infinitely easier for you if your code is laid out nicely and easier to read. Also the clauses in the query should go UPDATE, SET, WHERE, LIMIT; in that order. The WHERE clause should catch only a single row (assuming you check against a primary key column) but just in case the LIMIT is there to make sure only one row is affected.
PHP Code:
mysql_query(sprintf("
UPDATE
users
SET
username = '%s',
password = '%s',
email = '%s',
access = '%s',
joindate = '%s',
WHERE
id = %d
LIMIT 1
;",
mysql_real_escape_string($username),
mysql_real_escape_string($password),
mysql_real_escape_string($email),
mysql_real_escape_string($access),
mysql_real_escape_string($date),
(int) $id
)) or die(mysql_error());
|
|
|
|