Answers for "queries php"

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
0

php query

xPaw\SourceQuery\Exception\InvalidPacketException: Failed to read any data from socket in C:\xampp\htdocs\minecraft\vendor\xpaw\php-source-query-class\SourceQuery\BaseSocket.php:50
Stack trace:
#0 C:\xampp\htdocs\minecraft\vendor\xpaw\php-source-query-class\SourceQuery\Socket.php(76): xPaw\SourceQuery\BaseSocket->ReadInternal(Object(xPaw\SourceQuery\Buffer), 1400, Array)
#1 C:\xampp\htdocs\minecraft\vendor\xpaw\php-source-query-class\SourceQuery\SourceQuery.php(212): xPaw\SourceQuery\Socket->Read()
#2 C:\xampp\htdocs\minecraft\View.php(27): xPaw\SourceQuery\SourceQuery->GetInfo()
#3 {main}
Posted by: Guest on August-19-2021

Browse Popular Code Answers by Language