Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = mysql_connect("localhost","root","");
- if(!$con){
- die("Unable connect to mysql server");
- }
- mysql_select_db("test",$con);
- //$sql = "CREATE TABLE employee(name varchar(255),age int(11),salary DOUBLE);";
- //$sql = "INSERT INTO employee (name,age,salary) VALUES('Touhid',25,10000.50)";
- $sql = "SELECT * FROM employee";
- $query = mysql_query($sql,$con);
- echo "<table border=\"1\">";
- while($row = mysql_fetch_array($query)){
- echo "<tr><td>{$row['name']}</td><td>{$row['age']}</td><td>{$row['salary']}</td></tr>\n";
- }
- echo "</table>";
- if(!$query){
- echo mysql_error();
- }else{
- echo "Query Successful";
- }
- mysql_close($con);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement