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 758513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:29:15+00:00 2026-05-14T15:29:15+00:00

im just need the easiest way in php to navigate in this result: $datos

  • 0

im just need the easiest way in php to navigate in this result:

$datos = mysql_query(“SELECT * FROM
usuarios LIMIT 0, 30 “);

I mean, how do i do an echo from $datos in each element of the table?

Ex.
Table:

ID Name      LastName
1  Domingo   Sarmiento
2  Juan      Lopez

How can i read for example the second last name?

  • 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. Editorial Team
    Editorial Team
    2026-05-14T15:29:16+00:00Added an answer on May 14, 2026 at 3:29 pm

    mysql_query, when used for SELECT statements, returns a resource which you can use to return the found rows:

    $result = mysql_query("SELECT * FROM usuarios LIMIT 0, 30 ");
    
    while ($row = mysql_fetch_assoc($result)) {
        echo $row['ID'];
        echo $row['Name'];
        echo $row['LastName'];
    }
    

    Refer to the linked documentation for additional uses and functions.

    Since you are learning PHP/MySQL it would behoove me to point out the preferred method of interacting with databases: PDO. PDO affords a consistent interface to all supported databases with added benefits such as prepared statements and lowered injection risk, to name a couple.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code does not seem to compile, I just need to write something to
Seems so basic, I can't believe I don't know this! I just need a
I need to create a midnight DateTime I've just done this: DateTime endTime =
I'm deciding whether PHP is the best (easiest and most powerful) choice for this
Just looking to see if my assessment is correct on the easiest way to
This title is not fully depicted what I mean, but I just can't come
I'm currently deciding what way to build my Iphone/Android app. I just need to
I just need a way for my logo to be wrapped in an H1
I just need a file (picture, pdf or other type file for printing) of
I need to get just the first item (actually, just the first key) off

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.