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

Protecting forms
Alright, I want to protect some forms of mine from SQL Injections, because I had someone earlier spa

simple ping code
been searchin the site/web and found code thats simple but doesnt work.

I have a personal we

Join Query Help
Hi all,

I am having problems with the below code, which we shall call 'my first join query'!

login form can you find my error?
registrationform.php seems fine send data to registration.php
registration.php seems fine checks

unexpected T_SL without a shift left token
Nothing too see here, I'm an idiot and resolved the problem.

Collecting AOL Search Terms
I am attempting to collect AOL search terms. I know the code is correct (it works for google, bing,

Port scanner problem
Hai
recently i developed one app through which u can check the opened and closed ports under an

generating random codes
Hi guys n gals,

I have a requirement to generate 250,000 unique codes...

These codes a

Get keys and values from an array
Hellow,

I have an array $Data with keys and values. With a foreach I can display all the valu

Web Host List
Here is a list of web hosts that offer PHP and MySQL. It is no where near a full list, but it is mos

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