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

Why will this statement not print a column with "lastname space firstname"? Print " .$info['businessname'] "; Print " .$info['firstname']. " " .$info['lastname'] "; I want to see 2 columns - a

How do I return the date with mySQL?

First i created the log in page now i want to connect to the database from where username and password table is save.How i create the php codes to give relation between them?

What is the correct way to connect to a MySQL database?

the uploading status shows success but not showing in the server is empty the written php file is first gave warning cannot uploaded warning in foreach loop but i corrected mistake by keeping above if condition and no error status shows success upload b



Custom Search