Created
July 16, 2018 23:53
-
-
Save phpfiddle/5e7e0db371701d20eab9424df79cab1d to your computer and use it in GitHub Desktop.
[ Posted by TrapenokVictor ] CometQL example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$short_connect = new mysqli("app.comet-server.ru", "15", "lPXBFPqNg3f661JcegBY0N0dPXqUBdHXqj2cHf04PZgLHxT6z55e20ozojvMRvB8", "CometQL_v1"); | |
$sql = "show status"; | |
//result is boolean for query other than SELECT, SHOW, DESCRIBE and EXPLAIN | |
$result = $short_connect->query($sql); | |
if (($result) && ($result->num_rows > 0)) | |
{ | |
$results = array(); | |
//convert query result into an associative array | |
while ($row = $result->fetch_assoc()) | |
{ | |
$results[] = $row; | |
} | |
echo "<pre>"; | |
var_dump($results); | |
echo "</pre>"; | |
$result->free(); | |
} | |
$short_connect->close(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment