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

iterating through an array and escape each value independently.
I have a set up where the variable being escaped is an array and it needs to be iterated and escaped

Send inserts to mysql thru port 80
Hi!

I have an application that must do some inserts in a mysql db. This db is behind a firewa

Preloading images
Posting this question here because I am not sure where this should belong.I am building an asp.net a

Help with simple query
Hi,

I'm trying to do a Query with a Union where I want to print the number of rows $tc conta

php libs/ browsercap.in
ok i have a host that refuses to stay current. they control my php settings and libs. is there a way

Changing files over
Just thought I'd start with the new forums looking really nice .

Ok basically I've made this

Pulling out some result data from MYSQL
Hey Guys,

I've built a PHP page that has a for just imagine something like registration form

Could Someone Please Debug This?
I was wondering if someone could debug this script for me. I realize it's not the tidest script (and

frames get header location..
i have two frames, one top, one bottom. how do i do a form on the bottom frame that gives me the ur

links using header()
Hi All

I'm not sure where to ask for help on this but I hope someone can offer some. I'm at

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