我找不到我的错误。它说我在第 34 行有一个 T_RETURN 错误。
if ($type == 'post') {
$query = "INSERT INTO=Oktoberfest2013 (First Name, Last Name, Phone, Address, Department,Email Address, Level of Traning)
VALUES ('$fname','$lname', '$phone', '$address', '$department', '$email', '$level')";
if(!$mysqli->query($query))(
return Errormessage: $mysqli->error);
最后一行是第 34 行。
这是其余的代码:
require_once('config.php');
function connect() {
$mysqli = new mysqli( DB_HOST, DB_USER, DB_NAME, DB_PASS);
if( $mysqli->connect_error)
{die('connect_error ('. $mysqli->connect_error .')'
. $mysqli->connect_error);
}
return $mysqli;
}
Function insert ($types, $values) {
$mysqli = connect ();
if ($type == 'post') {
$query = "INSERT INTO=Oktoberfest2013 (First Name, Last Name, Phone, Address, Department,Email Address, Level of Traning)
VALUES ('$fname','$lname', '$phone', '$address', '$department', '$email', '$level')";
if(!$mysqli->query($query))(
return Errormessage: $mysqli->error);
}
Function select ($query) {
mysqli = connect();
$result=$mysqli->query($query);
While ($obj=$result->fetch_object(:)(
$result[] =$obj;)
return $return
?>