SQL错误bind_param()

时间:2014-01-27 16:55:26

标签: php sql mysqli

我的action.php中有错误 - 想知道是否有人可以提供帮助。

action.php的

if (isset($_GET['do']) && $_GET['do'] === "reg_type_2") {
     $teamname = $_POST["teamname"];
     $teamregion = $_POST["teamregion"];
     $teamleader = $_POST["teamleader"];
     $teammember = $_POST["teammember"];
     $wins = 0;
     $loses = 0;

     $stmt = $con->prepare("INSERT INTO `team_type_2` (`teamname`,`region`,`teamleader`,`teammember`,`wins`,`loses`) VALUES (?,?,?,?,?,?)");
     $stmt->bind_param('ssssii', $teamname, $teamregion, $teamleader, $teammember, $wins, $loses);
     $stmt->execute();
     $stmt->close();
 }

错误: Fatal error: Call to a member function bind_param() on a non-object in /home1/tony1964/public_html/2v2tournaments/action.php on line 38

-

第38行是$stmt->bind_param('ssssii', $teamname, $teamregion, $teamleader, $teammember, $wins, $loses);

0 个答案:

没有答案