I'm not able to insert the data into my table named, "test".
<html>
<head>
</head>
<body>
<?php
if(isset($_POST['add']))
{
include 'connect.php';
$mytest = $_POST['mytest'];
$query = "INSERT INTO 'test' ('testfield') VALUES ('$mytest')";
mysql_query($query) or die('Error, insert query failed');
mysql_close($conn);
}
?>
<form method="post">
Test data
<input name="mytest" type="text" id="mytest">
<P>
<input name="add" type="submit" id="add" value="Insert Data">
</form>
</body>
</html>
<html>
<head>
</head>
<body>
<?php
if(isset($_POST['add']))
{
include 'connect.php';
$mytest = $_POST['mytest'];
$query = "INSERT INTO 'test' ('testfield') VALUES ('$mytest')";
mysql_query($query) or die('Error, insert query failed');
mysql_close($conn);
}
?>
<form method="post">
Test data
<input name="mytest" type="text" id="mytest">
<P>
<input name="add" type="submit" id="add" value="Insert Data">
</form>
</body>
</html>