Networking, Programming and Graphics Tutorials

Using MySQL APIs in PHP to make SELECT query from database [2/2]

In next example we will extend the query to more complex and specific query.

This query will return you all male personal, ordered by age and will start from old to young mans.

<?php
$query
="select `id`, `name` from `staff` where `sex`='male' order by `age` desc";
$result=mysql_query($query);
?> 
And the above example will return you:

ID Name Sex Age
4 Peter Trump Male 46
1 John Smith Male 33
Rate this tutorial:                    
Networking, Programming and Graphics Tutorials - Using MySQL APIs in PHP to make SELECT query from database [2/2] - Networking, Programming and Graphics Tutorials

Need a specific tutorial? Do not hesitate and submit a request!
Related Tags: mysql php database select query  how to make select query in mysql  php using ajax to select query database  ajax query database select  how to make a php query to a database  how to make database query php  php mysql search Select * database where  select database dropdownlist + mysql  mysql select database script  ajax mysql select from database