prepare("SELECT Name FROM ClaimedCards WHERE Name = ?"); $stmt0->bind_param('s', h($_GET['Name']) ); $stmt0->execute(); $result = $stmt0->get_result(); if( $result->num_rows == 0){//generate a new card exit; $sql = <<query($sql); $data = array(); while ($row = $result->fetch_assoc()) { $data[] = $row['Text']; } $result->free(); while(count($data) < 24){//shouldn't happen, but eh. $data[] = "NEED MORE CARDS"; } $board_json = json_encode($data); //save it $stmt1 = $db->prepare("INSERT INTO ClaimedCards (Name, IP, BoardJson) VALUES(?,?,?)"); $stmt1->bind_param('sss', h($_GET['Name']), $_SERVER['REMOTE_ADDR'], $board_json ); $stmt1->execute(); $stmt1->free_result(); $stmt1->close(); } $stmt0->free_result(); $stmt0->close(); //load it again $stmt0 = $db->prepare("SELECT Name,BoardJson FROM ClaimedCards WHERE Name = ?"); $stmt0->bind_param('s', h($_GET['Name']) ); $stmt0->execute(); $result = $stmt0->get_result(); $row = $result->fetch_assoc(); $data = json_decode($row['BoardJson']); $name = $row['Name']; $stmt0->free_result(); $stmt0->close(); ?> C-SPAM BINGO

C-SPAM BINGO III
Player:




close(); ?>