PDA

View Full Version : DW,PHP and MYSQL


ramandeep
02-20-2006, 12:32 PM
Hi,
I made a simple user registration sytem with DW,PHP and MySQL.
http://thebigbargain.com/testing/login.php

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.

davidj
02-20-2006, 01: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);