select mysql
snippet in sql

query sql in php

user1947

$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();

mysql select statement

user9315

SELECT * FROM table_name;

--or

SELECT column1, column2
FROM table_name;

select mysql

user7392

SELECT column_name(s) FROM table_name

MySQL SELECT

user1087

SELECT select_list
FROM table_name;