-1
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\programs\School\reg.php on line 4使用php在mysql中插入數據時發生錯誤
這是生成的錯誤,並在下面找到我的編碼。如果我立即回答,將會有所幫助。
<?php
if(isset($_POST['Register'])) {
$con=mysql_connect('localhost', 'root', '');
$insert="insert into member(`Name`, `contact_email`, `contact_number`, `Year_joined`, `Degree`, `password`)values($_POST['Name'], $_POST['contact_email'], $_POST['contact_number'], $_POST['Year_joined'], $_POST['Degree'], $_POST['password'])";
if($select_db=mysql_select_db('ulagappar', $con)) {
$query=mysql_query($insert);
echo "<script type='text/javascript'>alert('Registered successfully!!!')</script>";
}
}
?>
<form action="reg.php" method="Post">
Name : <input type="text" name="Name"><br><br>
Email: <input type="text" name="contact_email"><br><br>
phone: <input type="Number" name="contact_number"><br><br>
Batch: <input type="Number" name="Year_joined"><br><br>
Qualification: <input type="text" name="Degree"><br><br>
Password : <input type="password" name="password"><br><br>
<input type="Submit" name="Register">
</form>