Home Tutorial Php Sql Php Sql Select

 
 

Php Sql Select
Posted on: December 10, 2010 at 12:00 AM
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:

Related Tags for Php Sql Select:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.