Home>

It's just a code that checks a simple email address and password and stores it in Mysql, but when you run it
"SQLSTATE [HY000]: General error" on the browser
Is displayed, but the actual data is properly INSERTed. Why does it behave like this?
* Common.php contains a simple function that performs irrelevant escape processing.

<! DOCTYPE html>
<html>
<head><meta charset = UTF-8>
<title>Temporary registration completed</title>
</head>
<body>
<? php
require_once ('../ common/common.php');
$post = sanitize ($_ POST);
$user_mail = $post ['user_mail'];
$user_pass1 = $post ['user_pass1'];
$user_hand = $post ['user_hand'];
$user_pass1 = md5 ($user_pass1);
$dsn ='mysql: host = localhost;dbname = idol;charset = utf8';
$user ='root';
$password ='';
$dbh = new PDO ($dsn, $user, $password);
$dbh->setAttribute (PDO :: ATTR_ERRMODE, PDO :: ERRMODE_EXCEPTION);
try
{
// $dbh->beginTransaction ();
$sql ='INSERT INTO mst_userdb (member_mail, member_pass, idol_name) VALUE (?,?,?)';
$stmh = $dbh->prepare ($sql);
$data [] = $user_mail;
$data [] = $user_pass1;
$data [] = $user_hand;
$stmh->execute ($data);
// $dbh->commit ();
$rec = $stmh->fetch (PDO :: FETCH_ASSOC);
var_dump ($rec);
print'Temporary registration is complete.<br />';
print'to the registered email address<br />';
print'There is a URL for official registration<br />';
print'Tap it to complete the registration. ';
print $rec ['member_mail'];

}
catch (Exception $e)
{
// $dbh->rollBack ();
print'We are sorry for the inconvenience caused by the failure. ';
print $e->getMessage ();
}
$dbh = null;
?>
</body>
</html>