PHP add til database error
Jeg har denne lille ting til at gå ind i min database og add nogle data:<?php
require_once('xxxx.php');
if (isset($_POST['submitBtn'])) {
$name = (isset($_POST['name'])) ? addslashes(htmlentities($_POST['name'])) : '' ;
$pass = (isset($_POST['pass'])) ? addslashes(htmlentities($_POST['pass'])) : '' ;
$email = (isset($_POST['email'])) ? addslashes(htmlentities($_POST['email'])) : '' ;
$race = race("Human");
$str = str("8");
$agi = agi("8");
$sta = sta("8");
$int = int("8");
$dex = dex("8");
$money = money("100");
$maxhp = maxhp("80");
$currenthp = currenthp("80");
$maxmana = maxmana("80");
$currentmana = currentmana("80");
//Minimum name and comment length.
if ((strlen($name) > 3)){
$sql = "INSERT INTO players (accountname,accountpass,email,race,str,agi,sta,int,dex,money,maxhp,currenthp,maxmana,currentmana) VALUES (";
$sql .= "'".$name."','".$pass."','".$email."','".$race."','".$str."','".$agi."','".$sta."','".$int."','".$dex."','".$money."','".$maxhp."','".$currenthp."','".$maxmana."','".$currentmana."')";
mysql_query($sql) or die(mysql_error());
}
header("Location: play.php");
}
else {
?>
<h1>Register</h1>
<form action="human.php" method="post" name="human">
<table>
<tr><th>Account Name:</th><td><input name="name" /></td></tr>
<tr><th>Account Password:</th><td><input name="pass" /></td></tr>
<tr><th>Email:</th><td><input name="email" /></td></tr>
<input type="submit" name="submitBtn" value="Register"/></td>
</tr>
</table>
</form>
<?php } ?>
Men jeg får denne error hver gang jeg prøver at register:
Fatal error: Call to undefined function: race() in /home/virtual/xxxx.dk/public_html/online/human.php on line 8
Nogle der kan se hvor min fejl ligger?
På forhånd mange tak for hjælpen :)
Mvh.
XsiX