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

  • SEARCH
  • Home
  • 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 8881401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:20:26+00:00 2026-06-14T20:20:26+00:00

how do I make this display the most recent users first? <?php $host=mysql13.000webhost.com; //

  • 0

how do I make this display the most recent users first?

<?php

$host="mysql13.000webhost.com"; // Host name 
$username="a2670376_Users"; // Mysql username 
$password="PASSWORD"; // Mysql password 
$db_name="a2670376_Pass"; // Database name 
$tbl_name="passes"; // Table name 

// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
mysql_select_db("$db_name")or die("cannot select DB");

// select record from mysql 
$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
?>
<table background='https://lh6.ggpht.com/DFABQFuYSXLBiB6qlvDPfOONOUxCiwM6_S-    dHnjW82iognQToTkORsy7RVXsAz0Y23w=w705' width='50%'>
<tr>
<th align='left'>Submition</th><th align='center'>ScreenName</th><th     align='right'>Password</th>
</tr>
<tr>
<th align='left'>
<hr color='lime' width='100%'/>
</th>
<th align='center'>
<hr color='lime' width='100%'/>
</th>
<th align='right'>
<hr color='lime' width='100%'/>
</th>
</tr>
<?php
while($rows=mysql_fetch_array($result)){
?>

<tr>
<td background='transparent' align='left'><i><b><? echo $rows['id']; ?></b></i></td>
<td background='transparent' align='center'><i><b><? echo $rows['username']; ?></b></i>    </td>
<td background='transparent' align='right'><i><b><? echo $rows['password']; ?></b></i>   </td>
</tr>

<?php
// close while loop 
}
?>

</table>

<?php
// close connection; 
mysql_close();
?>
<center>

so when this is ran on my website it shows it like this

1 username password

2 username password

3 username password

I want it to show like this

3 username password

2 username password

1 username password

the most recent first and I cant seem to figure it out

please don’t post things like use mysqli or its not safe I know that and I will fix it once I get it to work corectly

  • 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-06-14T20:20:28+00:00Added an answer on June 14, 2026 at 8:20 pm

    change your query to:

    // select record from mysql 
    $sql="SELECT * FROM $tbl_name order by id desc";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the bane of my life: Traceback (most recent call last): File C:\Users\User\Documents\PYTHON\GAME
I make this php program to access mysql data foreach ($arrayOfID as $ID) {
I am trying to display and capture only the most recent item from a
I am programming my first real PHP website and am wondering how to make
I'm using using the most recent version of facebook's php api sdk. I'm trying
i am trying to display just the most recent tweet on my home page
To make this more clear, I'm going to put code samples: $file = fopen('filename.ext',
I make this program :: #include<stdio.h> char *raw_input(char *msg); main() { char *s; *s
I make this post because a script of pure javascript tooltips, no jquery and
How do you make this type of button? I think it is Android 4+

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.