Get data from database query : Database Query : MySQL Database PHP Source Code


PHP Source Code » MySQL Database » Database Query »

 

Get data from database query



<html>
<body>
<ul>
<?php
$cnx = mysql_connect('mysql153.secureserver.net','navioo','password');
mysql_select_db('jamySql');

$employees = @mysql_query('SELECT ID, FirstName FROM Employee');
if (!$employees) {
  die('<p>Error retrieving employees from database!<br />'.
      'Error: ' . mysql_error() '</p>');
}

while ($employee = mysql_fetch_array($employees)) {
  $id   = $employee['ID'];
  $name = htmlspecialchars($author['Name']);
  echo("$name <br>");
  echo("$id <br>");
}

?>
</ul>

</p>
</body>
</html>
           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo MySQL Database
» Database Query