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

Error querying database.
I get the above error when trying to insert some values to a datatable.
Here's the code :

Help with looping
I have a comma separated list of colors taken from a database ($ICo) and a directory of images named

How to extract/download content from HTTPS page?
Hello to all the Members of this forum, Im Shoiab, A novice programmer in php.. for my first job I h

Lining up columns nicely.
Hello everyone, I'm having problems with making columns line up properly. Here is my code:

code help - pagination
Hi all, I have this code, basically a user logs into my site and they get this page.

The pro

WELCOME SCREEN
first of all let me tell you what does my script do,

it´s a very simple query to show a e

Motivational Posters
Hello,

I wonder how can i do them in php. Are there any sample codes that you can show me?

Text to picture Generator
Hello, i have found this script and it works really good^^ But i have one problem, i would like to c

Linux socket programming
Where can I find a good introduction to socket programming?

Display search result
Hi!

I have a SQL database with information about albums and track (music).

This is wh

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