Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2012
    Thanked 0 Times in 0 Posts

    myqsl database download of data to website page

    I'm trying to display data on a webpage that is relevant to that particular username. The only thing that would be completely unique for each row of data is the ID column.

    Currently, I'm able to display the data from each row but it displays all of the rows due to a while loop.


    Then the table code echos the $rows amd variables.

    // close while loop

    How do I get this to only display data that is relevant for that particular username?

  2. #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,947 Times in 4,908 Posts
    Change the SQL query. Which you didn't bother to show us, so I have no idea what it looks like.
    Be yourself. No one else is as qualified.

  3. #3
    Join Date
    Mar 2013
    Thanked 9 Times in 9 Posts
    Quote Originally Posted by jp12 View Post

    How do I get this to only display data that is relevant for that particular username?
    If $result must contain data for more than 1 user, say for other purposes in your script, than you need an IF statement in your while loop that looks for the id of the user whose data you want to display.

    Otherwise it would be simpler to retrieve from the db just the record you need to display using something like

    select * from users where id=xxxxx where xxxxx is the user's id in the db.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts