I'm sorry if this has been mentioned many times in the thread but I just want to ko some answer. Can someone tell me how I got an error like this
Parse error: syntax error, unexpected ';' in C:xampphtdocscreate.php on line 8
Here is my code:
<?php
mysql_connect("localhost","root");
mysql_select_db("comment");
if(isset($_POST['submit']))
(
$Name = $_POST['name'];
$Email = $_POST['email'];
mysql_query("INSERT INTO demo (c_name,c_email) VALUES ('$Name','$Email')");
echo "Inserted !!!";
)
?>
<form method = "post" action = "">
<div>
<label for="name">Your Name</label>
<input type="text" name="name" id="name">
<label for="email">Your Email</label>
<input type="text" name="email" id="email">
<label for="submit">Submit</label>
<input type="submit" name="submit" id="submit">
</div>
</form>
I'm pretty sure the php codes are correct so I ended up in confusion.
P.S. I've acknowledged that mysql_function are outdated now but I don't have the luxury to study for PDO or mysqli_ this semestral end term. Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…