View Full Version : DW,PHP and MYSQL

02-20-2006, 01:32 PM
I made a simple user registration sytem with DW,PHP and MySQL.

I want that when the user logins ,he can update his record.

I have inserted an update record but it displays the records of the first record in the DB rather than displaying the records of the user that is logged in.

How can we insert update record based on active session or user logged in.

02-20-2006, 02:07 PM
you will be setting a few vars when the user logs in

you will need to make the login details unique (username or both password and username)

where you have your recordset that displays the user details you need to add a where clause in your recordset...

mysql_select_db($database_pfm, $pfm);

$query_pfActive = sprintf("SELECT * FROM TABLE WHERE user='%s'", $_SESSION[MM_userName]);

$pfActive = mysql_query($query_pfActive, $pfm) or die(mysql_error());
$row_pfActive = mysql_fetch_assoc($pfActive);
$totalRows_pfActive = mysql_num_rows($pfActive);