Answers for "sql and php"

PHP
18

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
1

and php

$a and $b	And	true if both $a and $b are true.
$a or $b	Or	true if either $a or $b is true.
$a xor $b	Xor	true if either $a or $b is true, but not both.
! $a	Not	true if $a is not true.
$a && $b	And	true if both $a and $b are true.
$a || $b	Or	true if either $a or $b is true.
Posted by: Guest on December-22-2021

Browse Popular Code Answers by Language