PDO插入声明未发布

I dont get any errors, but when I refresh my database nothing seems to be going through. The connection credentials are definitely correct.

$query = $pdo->prepare('INSERT INTO direct_transfer (fname, lname, add, city, post, country, email, nummag, donate) VALUES (:fname, :lname, :add, :city, :post, :country, :email, :nummag, :donate)');
$query->execute(array(':fname'=>$fname,
 ':lname'=>$lname,
 ':add'=>$add,
 ':city'=>$city,
 ':post'=>$post,
 ':country'=>$country,
 ':email'=>$email,
 ':nummag'=>$nummag,
 ':donate'=>$donate));

When you use reserved words in mysql, you need to escape them in backticks:

... (fname, lname, `add`, city, post, country, email, nummag, donate) ...

You should also add error handling so that PDO tells you right away what is wrong.

You can tell PDO to throw exceptions by adding this after you connect to the database:

$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

You can also set the error handling mode when you open the connection, see the manual.

Without ':' in the array.

$query = $pdo->prepare('INSERT INTO `direct_transfer` (`fname`, `lname`, `add`, `city`, `post`, `country`, `email`, `nummag`, `donate`) VALUES (:fname, :lname, :add, :city, :post, :country, :email, :nummag, :donate)');

$query->execute(array('fname'=>$fname,
                      'lname'=>$lname,
                      'add'=>$add,
                      'city'=>$city,
                      'post'=>$post,
                      'country'=>$country,
                      'email'=>$email,
                      'nummag'=>$nummag,
                      'donate'=>$donate));