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"; }?>

210 Like 29 Dislike
Previous php-forum Next php-forum
Other php-forum

using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto

remove a ; from emails in textarea
Code: <?php

session_start();

$database_host = "localhost&qu

Upload file and add HTML
Hey everyone,

I have a client has meeting agendas and minutes that should be posted online. I

Seperate team from score
I am writing a site that does a NFL Pick 'em type application and I have a feed that gives me the sc

Motivational Posters
Hello,

I wonder how can i do them in php. Are there any sample codes that you can show me?

Problem with DB connection
Hello there! I'm new to this forum and I'm new to PHP coding also. I wrote something that doesn't ma

Checking if variable is 0 as opposed to NULL/Empty...
I'm trying to write some code that will retrieve a user's access level from my database and if it do

Form Help
Here is the form:

Line number On/Off | Expand/Contract<? include("../include/sess

SQL Query/echo not working
Hey all,

I'm trying to run (what I thought) was a simple operation and it isn't working. I h

php title problem
Hi,

I am having a problem managing my page title with PHP.

Currently I have my <

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