Skip to content

Instantly share code, notes, and snippets.

@phpfiddle
Created July 16, 2018 23:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpfiddle/5e7e0db371701d20eab9424df79cab1d to your computer and use it in GitHub Desktop.
Save phpfiddle/5e7e0db371701d20eab9424df79cab1d to your computer and use it in GitHub Desktop.
[ Posted by TrapenokVictor ] CometQL example
<?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