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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:34:38+00:00 2026-06-19T01:34:38+00:00

I have simple code for displaying images. I created table with 4 columns (ID,

  • 0

I have simple code for displaying images. I created table with 4 columns (ID, location, capture, equence) and inserted there 18 records. My question is: how to display all records from table in reverse mode? I need to make that the last entry will be displayed first, and the first entry displayed last.

What I need: 18-1
What I have now: 1-18

I was searching for simple codes to do that, but notwing worked at all. So i’d be very grateful if someone will help me to solve that problem.

Heres the basic code of my display script:


<?php

mysql_connect("localhost", "***", "***") or die(mysql_error());
mysql_select_db("martinidb1337") or die(mysql_error());

$result = mysql_query("SELECT * FROM klpgalerija") or die(mysql_error()); while($row = mysql_fetch_array( $result )) {

    echo '<p><img src="'.$row['location'].'"></p>';
}

  • 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-19T01:34:40+00:00Added an answer on June 19, 2026 at 1:34 am

    You have to use MySQL ORDER BY clause for that,

    SELECT * FROM klpgalerija ORDER BY id DESC
    

    Note: Please, don’t use mysql_* functions in new code. They are no longer maintained and are officially deprecated.

    So use either PDO or MySQLi (IMO PDO is way to go)

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

Sidebar

Related Questions

I have following css code for layout. td img {display: block;} While displaying images
Is there a simple HTML/XHTML/CSS Code for displaying an image after it is done
I have simple HTML code with some JavaScript. It looks like: <html> <head> <script
I have a simple code using ctypes: Python 3.1.1 (r311:74480, Feb 23 2010, 11:06:41)
I have this simple code (for making things shorted, the important bits are probably
I have a simple code in Entity Framework (EF) v4.1 code first: PasmISOContext db
I have this simple code, using Joda-time. Works fine, but I have a problem.
I have this simple code in a WPF application: ThreadStart start = delegate() {
I have this simple code where I am sending http request and reading all
I have a simple code below: import java.util.ArrayList; public class BoidList extends ArrayList {

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.