Skip to content

Instantly share code, notes, and snippets.

@kira423
kira423 / shoutBox.class.php
Last active December 10, 2015 02:58
ShoutBox Class
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
class Shoutbox {
public $response;
public function Shoutbox($nick = null, $msg = null, $op = null) {
if(!$nick && !$msg && $op == 'tick') {
$this->returnShouts();
@kira423
kira423 / gist:4221167
Created December 6, 2012 01:35
Tables from while loop
php part
$result = $db->query("SELECT * FROM r_winners GROUP BY date ORDER BY date DESC");
while($rows = $result->fetch_assoc()){
print"<table class='cashout' style='width:100%;'>
<th colspan='3'>".$rows['jackpot_name']." Winners</th>
<tr>
<td style='width:33%;'>".$rows['winner']."</td><td style='width:33%;'>$".$rows['amount']."</td><td style='width:33%;'>".date("m/d/Y", $rows['date'])."</td></tr>
</tr></table>";
}
output
@kira423
kira423 / gist:4040499
Created November 8, 2012 18:07
Pagination
<?php
// This Line is to be gotten rid of it is for error reporting //
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Include config file with database connection information //
include("config.php");
include("header.php");
// Get the username of the user currently logged in //
$username = $_SESSION['username'];