For your filter of recordset you want session variable == user id not URL parameter unless user id is being sent through url parameter. URL parameter would have to be something like this profilepage.php?UserID=1 to retrieve user id 1's info.
Also setting up the recordset is only half of retrieving and displaying dynamic info. The recordset retrieves the info to display it you have to drag the binding of the recordset from the binding window to the page where you want info displayed.
Actually i am very new to php...so here i am sending you the actual screenshot where you can see the actual recordset + binding to the page and the filter i am using...i am sure i am doing something wrong in filtering the record...but can't figure it out.
Please see the below screenshot for reference
You should use primary key auto-increment int as user_id in your database table setup and filter your recordset so user_id = session variable user_id instead of username.
Go to Dreamweaver menu/Window/Bindings to make sure bindings window is displayed. From bindings window drill down the Session folder to display your session bindings. In your filtered recordset make sure user_id is written how the user id is written in the session binding for user id. Ideally you would have the user id session setup as user_id with lowercase no spaces.
Use the test button on the recordset window to test the recordset. When your recordset is properly setup filtering from user_id through session variable and you test the recordset you will be prompted with a window to enter a 'test' user_id for the test and the user_id number you enter should only show the record for that user_id. When the recordset is properly tested you can place bindings from that recordset onto the page to display the recordset info on the page.
When you upload and test your page online make sure you are logged in with an active session for your user_id in order for the dynamic info from the recordset to display on the page.
I don't know why i cannot see my filtered record...as mentioned by you in the last post, i did everything the same but still cannot see the user record who has logged in. Although when i am testing the recordset query, i am getting the perfect answer/record but when i put those variables on the page from the binding panel, it never shows me anything.
One more thing, when i am changing the filter to none, the first record is being displayed.
A few ideas:
- Your session variable is most likely not “Username” as you show in the pic unless you personally wrote that Session variable yourself.
( Username =Useranme…more likely its something like Username = kt_login_id_user ...or something like that if YOU did not create the session variable)
- After log in, a successful redirect is easy to achieve, however a common mistake is that you have not added the “restrict access to this page” code, therefore the page that was redirected to, does not have the code needed to store/retrieve the session information. Ex: session_start()
If you have properly identified the session variable name, and you have confirmed that the page you are viewing is in session then you should have no trouble getting what you need for you recordset statement.
If all else fails, test your session by putting this on the page you are wanting to see the variables for:
This will list all of your varible names.
Thanks zipper...i got the right solution ...actually now i got the working session variable to put in...and my page started to work.