trench coat man
-
Posts
1 -
Joined
-
Last visited
Never
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Mysql / PHP Insert problem
in MySQL Help
Posted
[code]
<html>
<head>
<title>Add Mysql User</title>
<meta http-equiv = "Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
if(isset($_POST['add']))
{
include 'library/config.php';
include 'library/dbopen.php';
$username = $_POST['username'];
$password = $_POST['password'];
$query = "INSERT INTO users (name, password) VALUES ('$username', PASSWORD
('$password'))";
mysql_query($query) or die ('error! insert query failed!');
$query = "FLUSH PRIVILEGES";
mysql_query($query) or die ('error! insert query failed!');
include 'library/close.php';
echo 'New MySql added!';
}
else
{
?>
<form method="post">
<table width="400" border="0" cellspacing="1" cellpadding="2">
<tr>
<td width="100">Username</td>
<td><input name="username" type="text" id="username"></td>
</tr>
<tr>
<td width="100">Password</td>
<td><input name="password" type="password" id="password"></td>
</tr>
<tr>
<td width="100"> </td>
<td> </td>
</tr>
<tr>
<td width="100"> </td>
<td><input name="add" type="submit" id="add" value="Add New User"></td>
</tr>
</table>
</form>
<?php
}
?>
</body>
</html>
[/code]