我的查询将数据插入到记录中,但它也显示查询失败。它将记录插入数据库,但不是重定向到日历页面,而是显示查询失败。
//Create INSERT query
$qry = "INSERT INTO `customer`(`login_id`,`firstname`, `lastname`, `ad1`, `ad2`, `ad3`, `postcode`, `phone`, `email`) VALUES ('{$_SESSION['SESS_LOGIN_ID']}','{$_SESSION['SESS_FIRST_NAME']}','{$_SESSION['SESS_LAST_NAME']}', '$ad1', '$ad2', '$ad3', '$postcode', '$phone', '{$_SESSION['email']}');";
$result = @mysql_query($qry);
//Check whether the query was successful or not
if($result) {
//Create query
$qry="SELECT user.login_id, customer.customer_id, customer.email FROM user, customer
WHERE user.login_id = customer.login_id AND customer.login_id= .'{$_SESSION['SESS_LOGIN_ID']}'.";
$result=mysql_query($qry);
//Check whether the query was successful or not
if($result) {
if(mysql_num_rows($result) == 1) {
//Login Successful
session_regenerate_id();
$login = mysql_fetch_assoc($result);
$_SESSION['SESS_CUSTOMER_ID']= $login['customer_id'];
$_SESSION['SESS_CUSTOMER_EMAIL']= $login['email'];
session_write_close();
header("location: calendar.php");
exit();
}
} else {
die("Query failed");
}
}