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

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

Find only certain URLs from page ... regex (semi-complete script)
Hi guys,

What I need to do is take a page & extract all the URLs from the page &a

dropdown menu
Hello everbody,

I am php newbie.
I need to develop a program that once click the drop do

Refining of search Criteria
Dear Friends

I need a help, I have a search page which of cars related, which has different s

Why use interfaces in PHP (OOP)
I am learning OOP in PHP and its been a pretty good learning experience so far. What I didn't unders

Appending GET data with form submition
Okay, what I'm trying to do is to use a form to append an already existing GET data string.

I

Query failed issue with php script but works fine in mssql manager!
hi i have the script below which copies data from one table to another but will only insert new data

CE 7.1 and External GIS integration
Hi All,

We want to develop an application on CE 7.1 which uses GIS features from an exter

get multiple rows
Hi I want to get multiple rows from a db

I am using this for the db query
Code: public

Do While statement
hi guys,

This may sound trivial but im new to php and as part of an assignmenti have to const

how can i display php source code snippets ?
I am outputting some pho code .. and I want to display the source code so people can copy and paste

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