-2
Image of PHP script error錯誤:列計數與第1行的值計數不匹配
看不到錯誤發生的位置。
***服務器名,user_n,p_word,DBNAME都填寫並連接成功*
<?php
$servername = "";
$user_n = "";
$p_word = "";
$dbname = "";
// Create connection
$con = mysqli_connect($servername, $user_n, $p_word, $dbname);
// Check connection
if (mysqli_connect_errno())
{echo nl2br("Failed to connect to MySQL:".mysqli_connect_error()."\n ");}
else
{ echo nl2br("Established Database Connection \n");}
$sanemail = mysqli_real_escape_string($con,$_POST['email']);
$sanpassword = mysqli_real_escape_string($con,$_POST['password']);
$sanfname= mysqli_real_escape_string($con,$_POST['firstName']);
$sanlname = mysqli_real_escape_string($con,$_POST['lastName']);
$sanphone_number = mysqli_real_escape_string($con,$_POST['phoneNumber']);
$sanorganization = mysqli_real_escape_string($con,$_POST['organization']);
$sanjob = mysqli_real_escape_string($con,$_POST['job']);
$sanwebsite = mysqli_real_escape_string($con,$_POST['website']);
$sanphone_number_two = mysqli_real_escape_string($con,$_POST['secondNumber']);
$sanemail_number_two = mysqli_real_escape_string($con,$_POST['secondEmail']);
//insert query to insert from data into the capstone table
$sql = "INSERT INTO user_info(email, password, fname, lname, phone_number, organization, job, website, phone_number_two, email_number_two)
VALUES('$sanemail', '$sanpassword, '$sanfname', '$sanlname', '$sanphone_number', '$sanorganization, '$sanjob', '$sanwebsite', '$sanphone_number_two', '$sanemail_number_two')";
//check for error on insert
if (!mysqli_query($con,$sql))
{ die('Error:' .mysqli_error($con));}
echo "1 record added";
mysqli_close($con);
?>
您可能想要將錯誤添加爲文本;它使我們更容易閱讀它。 –