Forums
This topic is locked
How to Filter after login?
Posted 15 Jun 2006 06:30:15
1
has voted
15 Jun 2006 06:30:15 Magnus Nicklasson posted:
After some success, I now need help to get to the next level of my DWMX20004 website project. I have 10 tennisplayers registered as users in a tb_Player. In another table (tb_Videos), I intend to upload videoclips of their strokes. Here's the problem: If I log in with my username, another players videoclips are listed on the Detail Page, and I don't understand how I can get my videoclips listed. I use no Filter in the Recordset on the log in page. On the 2nd page (Welcome), I still have no filter in the Rs. Instead I have a link to the Video page, and in this link I have a Player_ID Filter. When I open the Video page, I can not see my own videoclips, but someone elses (always the same person, this person is the first person listed in the tb_Player). On the Video page, I have 2 Rs, Video and Player. My thought is that I need to have the Video Rs in order to display the info in the tb_Video, and I need the Player Rs to display the "Welcome username!" as a Session Variable. (Is there btw a better solution to create this Welcome message? How can I do a "Welcome FirstName!" instead of "Welcome MM_Username"?)I suspect I do something wrong when I set the Filters. But I'm not sure, as I don't really know what I'm doing, so I really would appreciate someone's help. Thanks to anyone who reads this and who gives my problem a thought.
Replies
Replied 15 Jun 2006 12:56:08
15 Jun 2006 12:56:08 Roddy Dairion replied:
Create a function that will search your table for the correct player using the player_ID.
simple example
<pre id=code><font face=courier size=2 id=code>
function search($player_ID)
{
$select = mysql_query("select * from table where player_id = $player_ID"
;
}
</font id=code></pre id=code>
Use the example above add your query etc..
simple example
<pre id=code><font face=courier size=2 id=code>
function search($player_ID)
{
$select = mysql_query("select * from table where player_id = $player_ID"
}
</font id=code></pre id=code>
Use the example above add your query etc..
Replied 17 Jun 2006 06:05:30
17 Jun 2006 06:05:30 Magnus Nicklasson replied:
This is what the code looks like now:
SELECT *
FROM tbPlayer
WHERE PlayerID = MMColParam
I use ASP VB; MS Access 2002; DWMX2004.
Could there be something wrong in the way I set up the tables in the db? Or do I include the wrong tables in the Rs? In the above code, I'm hoping to filter all players, so the Player who is logged in, would only see his video clips on the page, no-one elses.
Does it make a difference if the parameter is passed on in the URL in the actual link, or in a Go To Detail Page dialog box?
Thank you for taking the time to help me figure this out!
SELECT *
FROM tbPlayer
WHERE PlayerID = MMColParam
I use ASP VB; MS Access 2002; DWMX2004.
Could there be something wrong in the way I set up the tables in the db? Or do I include the wrong tables in the Rs? In the above code, I'm hoping to filter all players, so the Player who is logged in, would only see his video clips on the page, no-one elses.
Does it make a difference if the parameter is passed on in the URL in the actual link, or in a Go To Detail Page dialog box?
Thank you for taking the time to help me figure this out!
