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

PHP If Else statement for breadcrumb
Hi

I am trying to use a PHP if else statement to display a breadcrumb link on wordpress

How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignor

question about n
I was looking at some of the things you could do with php and one of the things I have tried is n.<

multipart emiail forms
Hi All,

I am new to the boards and I've been working on a form (which is rather massive, imo

MFC GUI Programming
I am working on a project right now that requires me to create a MFC Windows GUI. Basically it need

php include email form with attachment
I have had no luck with finding a email form all over the Internet for various reasons. Some insecur

remove trailing slash from array
I have the following array which contains trailing slashes I need to remove. What is the best way to

Extracting Long text from message class with parameters
Hi,

I would like to extract the long text from a message class. However, the long text ha

difference between datetimes
($row['totime']-$row['fromtime'])/60

this is giving me 0

example of totime and fromtim

Insert Failing.
Hey,
I am making a Sign up page for a website, but the insert query into the Database does not se

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