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

Help with syntax
Hi all!

The $bridge variable is not getting passed while it is contained in the line below:

PHP using IF to display error
i have a MySQL query and i want to display 1 thing only if the number of affected rows is >=1

Using loop to count number of entries
I'm writing a program that must ask user to type in numbers. After each entry, the program has to re

Saving PHP output as a file
I wondered if anyone knows how to save the rendered output of a PHP script as a file?

I have

Loop column after 2 results
Hello All.

Here is what I have:

Client ID Company name Clien

php mysql query from input textbox
Hi,

I have a text box, in that i have given the mysql query. I can able to get the query in v

NOOB needs help with upload file
The intent of this form is to create a folder for a client and upload an image into another folder '

How could I combine these arrays??
Hello.. I'm trying to figure out a way to combine these first two arrays to get the last array..

show the direct link into href
I want to display link on the page. i am fetching the data(URL) from database,actually before that i

A href problem under php
Hello...

I tried to explain the issue in an earlier post.. but was not clear enough....

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