Home Tutorial Php Sql Php Sql Select

 
 

Share on Google+Share on Google+
Php Sql Select
Posted on: December 10, 2010 at 12:00 AM
Advertisement
This example illustrates how to execute mysql select query in the php application.

Php Sql Select

 This example illustrates how to execute mysql select query in the php application.

In the previous example we have already execute many more select query for retrieving data from database but in this example we show mysql_select_db method, how it work and how it is used in php application.

 

Source Code of sql_select.php 

<?php
  $user="root";
  $pass="root";
  $dbname="test";
  $con = mysql_connect("localhost", $user, $passor 

         die("Connection Failure to Database");

  echo "Connected to database server successfully<br>";

  mysql_select_db($dbname, $conor die ($dbname . 

     "Database not found" . $user);

  echo "Database: " " | ". $dbname ." | "" is selected";

  mysql_close($con);
?>

Download Source Code

 

Output:

Advertisement

Related Tags for Php Sql Select:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 10, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com