コード例 #1
0
 public static function saveUser(Sport $user)
 {
     $conn = connection::getConnectionObject();
     $con = $conn->getConnection();
     $sql = $con->prepare("INSERT INTO AppUser VALUES (?,?,?,?)");
     $userid = $user->getUserId();
     $username = $user->getUsername();
     $roll = $user->getRole();
     $passsword = $user->getPassword();
     $sql->bind_param("ssss", $userid, $username, $roll, $passsword);
     if ($sql->execute() == TRUE) {
         echo "New record created successfully (sport added)";
     } else {
         //echo "Error in adding sport: " . $sql . "<br>" ;
         echo "Error in adding sport:";
     }
 }