PHP MYSQL SELECT

PHP MYSQL SELECT

The select statement is the basic command which grabs data from the database. The select statement can be very basic or more advanced. A basic select statement would grab all data from one database table and output it in a list or table.

Normally, the programmer grabs the desired data then lets html, css and javascript to apply special styling to the data.

Writing a Basic PHP MYSQL Select Statement

The basic SELECT statement can only take place when you connect and select a database. Once you have done that, you can select data.

include('connect.inc');
$db = db_connect();

$command = "SELECT * FROM table_sort " ;
$result= mysqli_query($db, $command);
$row = mysqli_fetch_assoc($result);
$first= $row['firstname'];
$last = $row['email'];

echo "".$first." ".$email;