如何获取PHP中的最后一个错误?

i just tried to connect my form the my sql using PHP but it always report 32767 with the function echo error_reporting() and i am using MAMP 2.1 on mac and this is my whole code :

$name = $_POST[name];
$topic = $_POST[topic];
$tell = $_POST[tell];
$birthDay = $_POST[birthDay];
$job = $_POST[job];
$email = $_POST[email];
$lastMajor = $_POST[lastMajor];
$major = $_POST[major];
$add = $_POST[add];
$today = "test";

$connectionString = mysqli_connect("localhost","root","root","myDB");
 if (mysqli_connect_errno()) 
{
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

mysqli_query($connectionString,"INSERT INTO coWork (topic , name , tell , birthDay , job , email , lastMajor , major, add , date )
     VALUES ('$topic', '$name','$tell','$birthDay','$job' , '$email' , '$lastMajor' , '$major' , '$add' , '$today')");

mysqli_close($connectionString);
echo error_reporting();

how do i fix this ?!!

error_reporting() => Sets which PHP errors are reported

To get/handle errors you have to use functions like error_get_last or set_error_handler

In your case you want to get the MySql error, so you have to use mysqli_error or mysqli_errno

if (!mysqli_query($connectionString, 'INSERT ...')) {
    printf("Error: %s
", mysqli_error($connectionString));
}

Like Quentin noted you are vulnerable to SQL injection attacks. So please use mysqli_real_escape_string or mysqli_prepare.