Answers for "MYSQL query select"

PHP
17

query sql in php

$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();
Posted by: Guest on February-05-2020
3

select query in mysql

SELECT * FROM `table_name`;
SELECT `col1`,`col2` FROM `table_name`;
SELECT `col1 as name`,`col2 as email` FROM `table_name`;
SELECT * FROM `table_name` WHERE id = '1';
Posted by: Guest on April-06-2021
3

select mysql

SELECT column_name(s) FROM table_name
Posted by: Guest on October-07-2020
0

mysql SELECT

SELECT 
  `nachname` , `vorname` 
FROM testadressen
WHERE vorname = 'Fischer'
Posted by: Guest on March-20-2021

Browse Popular Code Answers by Language