mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-26 16:56:19 +00:00
added base class file for sql as well as updated users to use class
This commit is contained in:
parent
b4ec05e9b3
commit
1b276e849a
2 changed files with 12 additions and 1 deletions
11
code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sql.php
Normal file
11
code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sql.php
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
class Sql{
|
||||
|
||||
public function db_query( $query, $values = array() )
|
||||
{
|
||||
echo "tst";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ public function checkUser($username)
|
|||
return "Username must be 5 or more characters.";
|
||||
} elseif (!preg_match('/^[a-z0-9\.]*$/', $username)) {
|
||||
return "Username can only contain numbers and letters.";
|
||||
} elseif (db_query("SELECT COUNT(*) FROM {users} WHERE name = :name", array(
|
||||
} elseif (sql::db_query("SELECT COUNT(*) FROM {users} WHERE name = :name", array(
|
||||
':name' => $username
|
||||
))->fetchField()) {
|
||||
return "Username " . $username . " is in use.";
|
||||
|
|
Loading…
Reference in a new issue