WAMP(php 5.3.13およびmysql 5.5.24)を使用しているphpに問題があります。私の問題は、登録フォームをテストしているときです。
include "config.php";
if(isset($_GET['confirm_registration'])){
User::ConfirmRegistration($_GET['confirm_registration']);
}
if(isset($_POST['confirm_registration'])){
$username= $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];
if(!Validator::Email($email)){
echo "Invalid email address";
} else {
User::BeginRegistration($username,$email,$password);
}
}
?>
<div id="contentWrapper">
<div id="form">
<form id="signup" method="POST" action="">
<div class="signup_form"><strong>Sign up</strong></div>
<div class="signup_form">
<label>Username</label>
<input type="text" id="username" name="username" size="30">
</div>
<div class="signup_form">
<label>E-Mail</label>
<input type='text' id='email' name='email' size="30">
</div>
<div class="signup_form">
<label>Password</label>
<input type='password' id='password' name='password' size="30">
</div>
<div class="signup_form">
<label></label>
<input type='submit' name="confirm_registration" value='Submit'>
</div>
</form>
</div>
</html>
query()
これはエラーです: 11行目の C:\wamp\www\zavrsni_rad\classes\DataBase.class.php の非オブジェクトのメンバー関数への呼び出し
ここにDataBaseクラスがあります:
class DataBase
{
public static $connection;
public static function Connect(){
self::$connection = new mysqli("localhost","root","","zavrsni_rad");
self::$connection->set_charset("utf8");
}
public static function Execute($query){
self::$connection->query($query);
}
public static function GetString($query){
$r = self::$connection->query($query);
$res_arr = $r->fetch_row();
return $res_arr[0];
}
public static function GetRow($query){
$r = self::$connection->query($query);
return $r->fetch_row();
}
public static function GetTable($query){
$r = self::$connection->query($query);
$res = array();
while($rw = $r->fetch_row()){
$res[] = $rw;
}
return $res;
}
public static function Disconnect(){
self::$connection->close();
}
}