lordsofvine
New Member
- Messages
- 41
- Reaction score
- 0
- Points
- 0
Parse error: syntax error, unexpected T_STRING in C:\wamp\www\xampler\phpadd.php on line 10
<?php
$con = mysql_connect("localhost","root","");
if ($con)
{
die('Could Not Connect: ' . mysql_error());
}
mysql_select_db("my_db, $con);
$sql="INSERT INTO person (FirstName, LastName, Age)
VALUES ('$_POST[firstname]','$_POST[lastname]','$_POST[age]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con)
?>
---------------------------------------
<html>
<body>
<form action="phpadd.php" method="POST">
Firstname: <input type="text" name="firstname" />
Lastname: <input type="text" name="lastname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
can anyone check whats wrong........ thanks so much
<?php
$con = mysql_connect("localhost","root","");
if ($con)
{
die('Could Not Connect: ' . mysql_error());
}
mysql_select_db("my_db, $con);
$sql="INSERT INTO person (FirstName, LastName, Age)
VALUES ('$_POST[firstname]','$_POST[lastname]','$_POST[age]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con)
?>
---------------------------------------
<html>
<body>
<form action="phpadd.php" method="POST">
Firstname: <input type="text" name="firstname" />
Lastname: <input type="text" name="lastname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
can anyone check whats wrong........ thanks so much