home

Php Select From Db Tutorial


For this example, we will assume we have already connected to the database and the database contains a table called "customers". We want to return a list names and email addresses for all of the customers in the table.

<ul> <?php $result = mysql_query('select fullname, email from customers'); if (!$result) { die('Could not execute query: '.mysql_errno().':'.mysql_error()); } while ($row = mysql_fetch_array($result)) { echo '<li>'.$row['fullname'] . ' : ' . $row['email'].'</li>'; } ?> </ul>

Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player

all rights reseverd by Cramerz.com©. web design london by dotPeak. hosting by HostBay
all contents on cramerz are the property of Cramerz.com