PHP PDO代码在云连接中未执行SQL INSERT;但在本地计算机上完美运行

时间:2018-12-01 07:45:59

标签: php mysql pdo

如果电子邮件ID不存在,我将尝试从提交页面插入数据。以下代码与本地Apache完美配合。但是,在GAE云中,根本不会执行INSERT语句。

    <?php
include("topmenu.php");
$student_name = trim($_POST['student_name']);
$email = trim($_POST['login_id']);
$password = $_POST['password'];

$course_name = 'Foundation Course in Website Development';

$hashed_password = password_hash($password, PASSWORD_DEFAULT);


include("cloudconnection.php");


$sql_check="SELECT * FROM User_info WHERE Email_ID='".$email."'";
$stmt1 = $db->prepare($sql_check);
$stmt1->execute();

$count = $stmt1->rowcount();
echo $count;





$sql="INSERT INTO `User_info` (Student_Name,Email_ID,Course_Name) VALUES ('".$student_name."','".$email."','".$course_name."') ";
   echo $sql;
    include("pdo.php");


   header("Location: login.php?q=1");



?>

0 个答案:

没有答案