Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 182161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:53:27+00:00 2026-05-11T14:53:27+00:00

Ok I have a table with a few fields. One of the fields is

  • 0

Ok I have a table with a few fields. One of the fields is username. There are many times where the username is the same, for example:

    • username: bob
    • password: bob
    • report: 1
    • username: bob
    • password: bob
    • report: 2

I did a SQL statement to select * where username='bob'; but when I do the following PHP function, it will only return the last result:

$thisrow = mysql_fetch_row($result); 

I need to get every field from every row. How should I go about doing this?

$mainsection='auth'; //The name of the table $query1='select * from auth where username='$user'';  $result = mysql_db_query($dbname, $query1) or die('Failed Query of ' . $query1);  //do the query $thisrow=mysql_fetch_row($result); echo 'Study: ' . $thisrow[1] . ' - ' . $thisrow[5]; 

Sorry for such a dumb question. I can’t seem to get the while loops of more than one field working for the life of me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T14:53:28+00:00Added an answer on May 11, 2026 at 2:53 pm

    mysql_fetch_row fetches each row one at a time. In order to retrieve multiple rows, you would use a while loop like this:

    while ($row = mysql_fetch_row($result)) {     // code } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few tables that have similar fields but not exactly the same.
I have a table with few columns and one of the column is DockNumber.
I have few thousands of records with few 100 fields in a MySQL Table.
I have a table where one of the fields is InDatabase (SQL Server bit
I have a table of data in MS Access 2007. There are 6 fields
I have an entity that has few fields. One of them is city name.
I have a table with a few rows of data. I would like to
I have the following problem. I have a table with a few hundred thousand
I have a table, tblDocs that has a few columns: DocName varchar(50) DocLocation int
I have a few classes, such as those that outline database table structure or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.