- Code: Select all
<!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>
Thanks in advance everyone.




