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

Comparing Values
Hi
I'm reading data from a database and this seems to work OK.

Each system has an associat

Wierd echo error?
Hi, i got the most wierd php error ever and i don't know why..
Code: echo "<t

New to Arrays
Hi I am new to PHP (a week and a half now) and I am just beginning to read about arrays. I understan

CRM?
I think that's what they're called. Customer Management System? Anyway. Is there any good free ones

help with Get_
ok some how this is not working i am not sure what i am doing wrong here but what this does is when

While Problem
i am having a problem with a while statement here is the code
Code: [Select]<?php
sess

Simple MySQL script is not working
Hey guys,

Just familiarizing myself with PHP and MySQL. I am following along in the O'Reilly

Firewall / visited websites logger
Hi. I have a firewall implementation and I want to log all the websites visited on the machine. S

cPanel API
Hi Guys,

Need a little guidance. I'm trying to get my script to communicate with cPanel (or W

imap: how to save a copy of sent emails to sent elements
Hello my friends,

I am writing an online emailing application with inbox outbox/sent elements

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