Networking, Programming and Graphics Tutorials

MySQL SELECT query from PHP script [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 - MySQL SELECT query from PHP script [2/2] - Networking, Programming and Graphics Tutorials

Need a specific tutorial? Do not hesitate and submit a request!
Related Tags: mysql query from script select  php script mysql select query  php script+mysql+select query  php script mysql query select from table  php select query script  select query script of php  select query script  php script select query  SELECT query from PHP script [1/2]  script query select  select query in php script  select query +php+script  php script for select query  code for select query in php script  php script creating a select query  statement select query script  select query with html script  select query PHP sample script  mysql query datbase php query script  mysql select script