コード例 #1
0
ファイル: checkuser.php プロジェクト: robinrob/php
<?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>&nbsp;&larr;\n\t\t\tSorry, already taken</font>";
    } else {
        echo "<font color=green>&nbsp;&larr;\n\t\t\tUsername available</font>";
    }
}
コード例 #2
0
ファイル: game.php プロジェクト: Geekfish/oshi-php
 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;
 }