0 Replies Latest reply on Aug 28, 2008 3:35 PM by (Iain_MacDonald)

    Update User Profile

      Hope someone can help with this. <br /> <br />Basically I have a site where users can log in to access various pages. I have created pages to add and edit User details, eg password, email address etc. <br /> <br />This works great for anyone logged in editing pages as normal. <br /> <br />I also have session variables recording who is logged in. <br /> <br />As such, I'd like to have a version of my editUserDetails page that effectively acts as a page where the current user logged in can make changes to their own profile. <br /> <br />So really I need to change the query. <br /> <br />On the editUserDetails page, its presumably filtering on UserID - but the query isn't at the top of the page, but rather looks as though its referenced from elsewhere : <br /> <br />// Get the transaction recordset <br />$rsUsers = $tNGs-&gt;getRecordset("Users"); <br />$row_rsUsers = mysql_fetch_assoc($rsUsers); <br />$totalRows_rsUsers = mysql_num_rows($rsUsers); <br /> <br />Where is that query "Users" actually defined? <br /> <br />Basically I want to change the query to query on the session variable Username : <br /> <br /><?php<br />$colname_rsUsers = "-1";<br />if (isset($_SESSION['UserID'])) {<br />  $colname_rsUsers = (get_magic_quotes_gpc()) ? $_SESSION['UserID'] : addslashes($_SESSION['UserID']);<br />}<br />mysql_select_db($database_connSearchTechUK, $connSearchTechUK);<br />$query_rsUsers = sprintf("SELECT * FROM Users WHERE UserID = %s", GetSQLValueString($colname_rsUsers, "-1"));<br />$rsUsers = mysql_query($query_rsUsers, $connSearchTechUK) or die(mysql_error());<br />$row_rsUsers = mysql_fetch_assoc($rsUsers);<br />$totalRows_rsUsers = mysql_num_rows($rsUsers);<br />?> <br /> <br />I've tried swapping the former with the later, and it works insomuch as it does display the record of the user currently logged on, but when I hit submit after making any edits, the page just refreshes with the old details. <br /> <br />Hope that makes some sense - if anyone could point me in the right direction, that would be much appreciated.