Check out example codes for "MySQL SELECT". It will help you in understanding the concepts better.

Code Example 1

SELECT column1, column2,...
FROM table_name
WHERE first_name = 'John' AND sales_in_year <= 50

Code Example 2

SELECT * FROM table_name;

--or

SELECT column1, column2
FROM table_name;

Code Example 3

<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {

    die("Connection failed: " . $conn->connect_error);

 } 

$sql = "SELECT id, firstname, lastname FROM MyGuests";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
  // output data of each row

    while($row = $result->fetch_assoc()) {
    echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";

    }
} else {
  echo "0 results";
}

 $conn->close();

?>

Code Example 4

echo $select->__toString();

Code Example 5

$sqlSelect = "SELECT * FROM manifest";
$result = mysql_query($conn, $sqlSelect);
            
if (mysql_num_rows($result) > 0) {
<table id='userTable'>
    <thead>

Code Example 6

SELECT select_list
FROM table_name;

Learn ReactJs, React Native from akashmittal.com