我在JavaScript中創建了一個將用戶選擇的'圖像'文件轉換爲dataURI的函數。然後我通過POST方法將它傳遞給一個php腳本。問題是當我試圖將這些信息保存到MySQL中時,如下所示:將dataURI圖像從JavaScript解析到PHP
$him = $_POST["him"];
$req = $pdo->prepare("INSERT INTO `cr`.`chercheur`
(`cin`, `nom`, `prenom`, `statut`,
`tel1`, `email`, `tof`, `etat`)
VALUES (?, ?, ?, ?, ?,?, ?, '0')");
$req->execute(array($cin,$nom,$prenom,$statu,$tel,$mail,$him));
我在下面得到一個錯誤。
Warning: PDOStatement::execute(): MySQL server has gone away in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\projects\CR\module\compte\demande\dem_user.php on line 89
Warning: PDOStatement::execute(): Error reading result set's header in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\projects\CR\module\compte\demande\dem_user.php on line 89 SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
正如它所說,您的MySQL服務器不可用:請參閱http://stackoverflow.com/questions/1644432/mysql-server-has-gone-away-in-exactly-60-seconds – sitilge