Php Sql Select


 

Php Sql Select

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

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:

Ads