PHP Questions Home
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I order the results of my query?


To order the results, use the ORDER BY wording.

So if you have a list of first names, you will often want to order them alphabetically and not in the jumbled format that they come out of the database. So here's how to do it:

<?php
$atozofnames 
mysql_query("SELECT firstname FROM names ORDER BY firstname");
?>



ASK A QUESTION

More mysql PHP Questions

How do I insert the date into my table?

My website www.quicheandpie.com has navigation buttons which were added by going to admin/categorylist and adding a category. I can add category = navigation buttons and update them, but I can not delete them. Any ideas how I can find where the info

How do i list a record in front that is recently added to the table?

How do I set a default value for ENUM fields in PHP?

How do I find the number of rows in a result set?



Custom Search