<?php //checkuser.php include_once 'functions.php'; if (isset($_POST['user'])) { $user = sanitiseString($_POST['user']); $query = "SELET * FROM members WHERE user='******'"; if (mysql_num_row(queryMysql($query))) { echo "<font color=red> ←\n\t\t\tSorry, already taken</font>"; } else { echo "<font color=green> ←\n\t\t\tUsername available</font>"; } }
public function GetPawnByCoords($x, $y) { $id = (int) $this->Id; $x = (int) $x; $y = (int) $y; $sql = "SELECT `id`\r\n\t\t\t\tFROM `pawnsig`\r\n\t\t\t\tWHERE\r\n\t\t\t\t\t`game_id` = '{$id}'\r\n\t\t\t\tAND\r\n\t\t\t\t\t`x` = {$x}\r\n\t\t\t\tAND\r\n\t\t\t\t\t`y` = {$y}\r\n\t\t\t\tLIMIT 1;\r\n\t\t\t\t"; $res = mysql_query($sql); if (mysql_num_row($res)) { $row = mysql_fetch_array($res); return new Pawnig($row['id']); } return false; }