• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need help with php code

cw42

Diamond Member
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>
 
I might be missing something easy, but I really doubt you'll get much help with so little information.
 
Back
Top