Display last record first.


Posted on 16th Feb 2014 07:03 pm by admin

I need some help how put the last record first and first record last.

Thanks

Did you know?Explore Trending and Topic pages for more stories like this.
Code: <?php
include("connect.php");

$query="SELECT * FROM MyNotes ";
$result=mysql_query($query);
$num = mysql_num_rows ($result);
mysql_close();

if ($num > 0 ) {
$i=0;
while ($i < $num) {
$username = mysql_result($result,$i,"username");
$notes = mysql_result($result,$i,"notes");
$id = mysql_result($result,$i,"id");

echo "<b>notes:</b> $notes
";
echo "<hr><BR>";

++$i; } } else { echo "The database is empty"; }?>
No comments posted yet

Your Answer:

Login to answer
210 Like 29 Dislike
Previous forums Next forums
Other forums

Upload, SSL and more php help
I recently just installed a ssl cert and do i use https for the whole site or just for the checkout.

How to show the difference between two data field in a database with php.
Hello php gurus,

how r u all... i'm not so well facing a typical problem please help me...<

Using insert variable
need a way to inert variable data to mysql database

$acc = "212121212";
$nok =

Image DPI
Hi.

I allow users to upload images, the user then is able to adjust several settings for the

BackButton Behaviour in AJAX
I have an ASPX Page AJAX Enabled!The page has a gridView and a DDL for filtering on it. The Gridview

Looping Problem
I've got a client that has a database with about 200 events at any given time. I'm trying to loop t

Simple email form - Newbie
Hello all,

First time poster!

I've been asked to create a simple HTML form that submit

Inserting the current date/time while submitting the forum
What do I need to add below to update the current date/time? I have a field in the database called d

Locking mysql tables with php
Hi

BACKGROUND:
I have multiple instances of the same php script running in a WAMP environ

Help with setcookie()
Merry Xmas to those on this foruum
Older guy here with some experience but not allot so please be

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash