<html> <head> <title>Retrieve data from database </title> </head> <body> <?php // Connect to database server mysql_connect("mysql.myhost.com", "user", "sesame") or die (mysql_error ()); // Select database mysql_select_db("mydatabase") or die(mysql_error()); // SQL query $strSQL = "SELECT * FROM people"; // Execute the query (the recordset $rs contains the result) $rs = mysql_query($strSQL); // Loop the recordset $rs // Each row will be made into an array ($row) using mysql_fetch_array while($row = mysql_fetch_array($rs)) { // Write the value of the column FirstName (which is now in the array $row) echo $row['FirstName'] . "<br />"; } // Close the database connection mysql_close(); ?> </body> </html>
Tuesday, 9 December 2014
How to retrieve data from database
Sunday, 7 December 2014
progress in website..
Assalamualaikum.. Hai.. Now i working on the database and simple coding for the website.. hehehe.. need somebody to help me on the coding side.. Ofcoz, mr google will my references and also my lecture... hehehe...
Subscribe to:
Comments (Atom)