Skip to content

Instantly share code, notes, and snippets.

@Nasawa
Created May 22, 2014 04:19
Show Gist options
  • Save Nasawa/6ba72988b3d13899424d to your computer and use it in GitHub Desktop.
Save Nasawa/6ba72988b3d13899424d to your computer and use it in GitHub Desktop.
gs sql query example
<?php
require 'master.php'; //sets obfuscated variables and connections
$userid = $_GET["userid"];
mysqli_query("SET SESSION time_zone = '+00:00'");
$query = "SELECT $dbuserid, $dbcell, ($dbduration - (time_to_sec(CURTIME()) - time_to_sec($dbstart))) as seconds, $dbcount, $dbactive FROM $dbusertable WHERE $dbactive = 0 AND $dbverified = 1 AND $dbclient = 1 AND CURTIME() > $dbstart AND (time_to_sec(CURTIME()) - duration) < time_to_sec($dbstart)";
$result = $db->query($query);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment