Skip to content

Instantly share code, notes, and snippets.

@Soulflare3
Created August 13, 2015 02:26
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 Soulflare3/4c89069de0d621402698 to your computer and use it in GitHub Desktop.
Save Soulflare3/4c89069de0d621402698 to your computer and use it in GitHub Desktop.
Partial of Bot.php | DB Query
$db = new SQLite3('/home/ChronalRobot/handmade.db');
if(!$db)
{
echo $db->lastErrorMsg();
}
$prerender .= "</section><table cellpadding=\"5\" class=\"heavyTable\"><thead><tr><th width=\"10%\">ID</th><th width=\"80%\">Quote</th><th width=\"10%\">Timestamp</th></tr></thead><tbody>";
$results = $db->query('SELECT id, text, timestamp FROM quote');
while ($row = $results->fetchArray())
{
$quotes++;
$prerender .= "<tr><td width=\"10%\">". $row['id'] . "</td><td width=\"50%\">". $row['text'] . "</td><td width=\"50%\">". date('Y-m-d', $row['timestamp']) . "</td></tr>";
}
$prerender .= "</tbody></table><section class=\"content\">";
$db->close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment