Page 2 of 2 First 12
  • Jump to page:
    #16
  1. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,921
    Rep Power
    1045
    Yes, that helps a lot.

    In the link to the user choices, pass the user ID (or any unique identifier) as a URL parameter:

    Code:
    http://yourpage.com/predictions.php?user_id=123
    You can then fetch the ID from the URL and use it in your queries:

    PHP Code:
    $user_id $_GET['user_id']; 
    So the only difference is that the user ID now comes from the $_GET array rather than the $_SESSION array.

    Note, however, that you mustn't insert any user-defined parameter directly into your query, because this can lead to SQL injections. Check the first link in my signature in case you're not familiar with that risk.

    I also wonder why you have both the user ID and the user name in your table. Don't you have a separate table for the users?
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  2. #17
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    23
    Rep Power
    0
    Thanks Jacques I will work on it you are a life saver. Plus I set up the table that way because I was struggling with join and union, this is all still local but will fix thanks.
  4. #18
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    23
    Rep Power
    0
    Was able to get everything working thanks Jacques
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo