I'm stuck! I have a page that should be adding a listing in my database. When the form submits, the page refreshes with blank fields and nothing happens. Nothing is added to the database. Any idea what I might be doing wrong here?
What output/error do you get with this? <?php error_reporting(E_ALL); include ("include/header.inc.php"); ?> <h1>Add a Listing</h1> <?php include("include/dbconnect.php"); if(isset($_POST['submit'])) { $item = mysql_real_escape_string($_POST['item']); $detail = mysql_real_escape_string($_POST['detail']); $sql = "INSERT INTO $table (item, detail) VALUES ('$item','$detail')"; $result = mysql_query($sql) OR die(mysql_error()); echo "<br><br>Item has been added.\n"; } else { ?> <form method="post" action="<?php echo $_SERVER['SCRIPT_NAME'] ;?>"> <table width="380" border="0" cellspacing="1" cellpadding="1"> <tr> <td> <input type="hidden" name="id" value="<?php echo $myrow["id"]?>"> Item:</td> <td> <input type="Text" name="item" size="35"> </td> </tr> <tr> <td>Detail: </td> <td> <input type="Text" name="detail" size="35"> </td> </tr> </table> <input type="Submit" name="submit" value="Enter information"> </form> <?php } include ("include/footer.inc.php"); ?> PHP: