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

Not showing whole name with mail () script
I sent up a simple mail form with the PHP mail() script. One problem is when it sends an email with

progress bar...need expert opinion of experienced webmaster
Hey guys, quick question:

I want to display a progress bar when I upload files, but I am not

does anyone know a php script to send mail using gmails/googles free smtp server
cause i heard u can do that but i dont know how

url- go to webpage
i have an input text field and submit button.

how do i make the url entered into the textfiel

PHP - MySQL Fail
My PHP code will only execute the first part of my code...

Code: <?php

sessio

problem when runing a funciton
I am trying to connect to database using a funciton in a functions.php

<?php
funct

Preventing SQL Injection
I have a question about SQL Injection, In some of our code we use this: view plaincopy to clipboa

this code is not working????
it says this error.. Warning: Division by zero in ..

the variables are correct, so why is th

Mysql error message
help me find out what this error message means:

"Duplicate entry '0' for key 'PRIMARY'&q

Reduce redundancies in switch functions?
Hello all! I somewhat new to PHP, and was wondering if anyone could give some suggestions on a swit

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