It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

News

Log In Sponsors
Partner Sites

Parse Error!!?



Anyone know what's wrong with this? I get this error... Parse error: syntax error, unexpected ';' in /Applications/xampp/xamppfiles/htdocs/insert.php on line 19. I followed the steps on [url=http://www.w3schools.com/php/php_mysql_insert.asp:214ahfke]here[/url:214ahfke] and just changed the stuff in there to suit me. But it isn't working, I tried it the other night on an online DB and I though that was the problem but it isn't any ideas? The form works and it connects ok it' just that error.

[code:214ahfke]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
$con = mysql_connect("localhost","TestUser","admin");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// some code
mysql_select_db("TESTDB", $con);
mysql_query("INSERT INTO User (username, password, email, mobi_user)
VALUES
('$_POST[username]','$_POST[password]','$_POST[email]','$_POST[mobi])";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con)

?>

</body>
</html>[/code:214ahfke]

Thanks in advance everyone.

Click here to read the whole forum topic