Skip to main content
Participant
August 23, 2012
Question

Php update record Question

  • August 23, 2012
  • 1 reply
  • 639 views

Hi im kind of a new b to dreamweaver, and i have made a website with a login page using my sql and i want users to login and on there home page (which i have already made) let them to update there database info. i have tryed using the update record but it changes the top person on the database and not the logged in user.

thank you.

This topic has been closed for replies.

1 reply

Drymetal
Inspiring
September 1, 2012

I'm not sure I understand your question fully, but I'll try to help.   It sounds like you are just pulling a recordset in Dreamweaver without defining which record to specifically to pull.  So it is pulling all of them and updating the first one in your database.   To fix this - you need to filter your result.   Look at the screenshot below:

What I have there is a recordset getting the User Info.  If you look at the filter box, I have it set to filter the Username and that it is Equal to the Session Variable MM_Username.

When you create a login page in Dreamweaver, it automatically creates a session when the user logs in called MM_Username.  So we are making sure that the user recordset is pulling the user info for the person logged in.

To make sure this works - on the update page - you'll want to restrict access based on whether or not the user is logged in.  Otherwise this won't work.  To do that, do this:

Server Behaviors - User Authentication - Restrict Access to Page.

Assuming you aren't worried about Access Levels, set your settings as such in the Restrict Access to Page Dialog:

Anyways, I hope that helps.