Here it is: Submit.PHP Code: <select name="select"> <option name="1">Pistols</option> <option name="2">Gas Pistols</option> <option name="3">Spring Rifles</option> <option name="4">Electric Rifles</option> <option name="5">Gas Rifles</option> <option name="6">Shotguns</option> <option name="7">Accessories</option> </select> <?php include("dbconnect.php") ?> <?php if(isset($_POST['submit'])) { $link=$_POST['link']; $name=$_POST['name']; $model=$_POST['model']; $status=$_POST['status']; $type=$_POST['type']; $buy=$_POST['buy']; if(select=="1") { $sql = mysql_query("INSERT INTO `pistols` ( `link` , `name` , `model`, `status`, `type`, `buy` ) VALUES ('$link', '$name', '$model', '$status', '$type', '$buy');"); } if(select=="2") { $sql = mysql_query("INSERT INTO `gaspistols` ( `link` , `name` , `model`, `status`, `type`, `buy` ) VALUES ('$link', '$name', '$model', '$status', '$type', '$buy');"); } if(select=="3") { $sql = mysql_query("INSERT INTO `springrifles` ( `link` , `name` , `model`, `status`, `type`, `buy` ) VALUES ('$link', '$name', '$model', '$status', '$type', '$buy');"); } if(select=="4") { $sql = mysql_query("INSERT INTO `electricrifles` ( `link` , `name` , `model`, `status`, `type`, `buy` ) VALUES ('$link', '$name', '$model', '$status', '$type', '$buy');"); } if(select=="5") { $sql = mysql_query("INSERT INTO `gasrifles` ( `link` , `name` , `model`, `status`, `type`, `buy` ) VALUES ('$link', '$name', '$model', '$status', '$type', '$buy');"); } if(select=="6") { $sql = mysql_query("INSERT INTO `shotguns` ( `link` , `name` , `model`, `status`, `type`, `buy` ) VALUES ('$link', '$name', '$model', '$status', '$type', '$buy');"); } if(select=="7") { $sql = mysql_query("INSERT INTO `accessories` ( `link` , `name` , `model`, `status`, `type`, `buy` ) VALUES ('$link', '$name', '$model', '$status', '$type', '$buy');"); } echo 'Thank you for your new submission!'; } ?> <form method="post" action="submit.php"> <table width="52%" height="459" border="0"> <tr> <td height="29" valign="top">Link </td> <td valign="top"> <input type="text" name="link" size="25"> </td> </tr> <tr> <td valign="top">Name </td> <td valign="top"> <input name="name" type="text" size="25"> </td> </tr> <tr> <td valign="top">Model </td> <td valign="top"> <input name="model" type="text" size="25"> </td> </tr> <tr> <td height="85" valign="top">Status </td> <td valign="top"> <textarea name="status" size="25"></textarea> </td> </tr> <tr> <td height="85" valign="top">Type </td> <td valign="top"> <textarea name="type" size="25"></textarea> </td> </tr> <tr> <td height="85" valign="top">Buy </td> <td valign="top"> <textarea name="buy" size="25"></textarea> </td> </tr> <tr> <td height="25" valign="top"></td> <td valign="top"><input type="submit" name="submit" value="Submit New Model!"></td> </tr> </table></form> Display.PHP Code: <?php include("dbconnect.php") ?> <?php include("style.css") ?> <?php $limit = 100; // $query = "SELECT * FROM pistols ORDER BY id DESC LIMIT 0, $limit"; $result = mysql_query($query) or die("Error: " . mysql_error()); if(mysql_num_rows($result) == 0){ echo("There are no models!"); } $bgcolor = "transparent"; echo("<table bgcolor='transparent' width='100%' cellpadding='2' cellspacing='0'>"); while($query=mysql_fetch_array($result)){ extract($query); echo("<table> <tr> <td><img src=$link></img></td> </tr> <tr> <td>[b]$name[/b]</td> </tr> <tr> <td>[i]$model[/i]</td> </tr> <tr> <td>[u]$status[/u]</td> </tr> <tr> <td>[b]$type[/b]</td> </tr> <tr> <td>[url="$buy><img"]</img>[/url]</td> </tr> </table>"); } echo("</table>"); ?> Okay, now, when I use submit.php to submit the new model, I get the message I should when it works but then it says it doesn't submit it to the table so I can't query the table and display it with display.php. I need help ASAP.
Try this, should get rid of the errors Code: <select name="select"> <option name="1">Pistols</option> <option name="2">Gas Pistols</option> <option name="3">Spring Rifles</option> <option name="4">Electric Rifles</option> <option name="5">Gas Rifles</option> <option name="6">Shotguns</option> <option name="7">Accessories</option> </select> <?php include("dbconnect.php") ?> <?php if(isset($_POST['submit'])) { $link=$_POST['link']; $name=$_POST['name']; $model=$_POST['model']; $status=$_POST['status']; $type=$_POST['type']; $buy=$_POST['buy']; if(select=="1") { $sql = mysql_query("INSERT INTO `pistols` ( `link` , `name` , `model`, `status`, `type`, `buy` ) VALUES ('$link', '$name', '$model', '$status', '$type', '$buy');"); } if(select=="2") { $sql = mysql_query("INSERT INTO `gaspistols` ( `link` , `name` , `model`, `status`, `type`, `buy` ) VALUES ('$link', '$name', '$model', '$status', '$type', '$buy');"); } if(select=="3") { $sql = mysql_query("INSERT INTO `springrifles` ( `link` , `name` , `model`, `status`, `type`, `buy` ) VALUES ('$link', '$name', '$model', '$status', '$type', '$buy');"); } if(select=="4") { $sql = mysql_query("INSERT INTO `electricrifles` ( `link` , `name` , `model`, `status`, `type`, `buy` ) VALUES ('$link', '$name', '$model', '$status', '$type', '$buy');"); } if(select=="5") { $sql = mysql_query("INSERT INTO `gasrifles` ( `link` , `name` , `model`, `status`, `type`, `buy` ) VALUES ('$link', '$name', '$model', '$status', '$type', '$buy');"); } if(select=="6") { $sql = mysql_query("INSERT INTO `shotguns` ( `link` , `name` , `model`, `status`, `type`, `buy` ) VALUES ('$link', '$name', '$model', '$status', '$type', '$buy');"); } if(select=="7") { $sql = mysql_query("INSERT INTO `accessories` ( `link` , `name` , `model`, `status`, `type`, `buy` ) VALUES ('$link', '$name', '$model', '$status', '$type', '$buy');"); } echo 'Thank you for your new submission!'; } ?> <form method="post" action="submit.php"> <table width="52%" height="459" border="0"> <tr> <td height="29" valign="top">Link </td> <td valign="top"> <input type="text" name="link" size="25"> </td> </tr> <tr> <td valign="top">Name </td> <td valign="top"> <input name="name" type="text" size="25"> </td> </tr> <tr> <td valign="top">Model </td> <td valign="top"> <input name="model" type="text" size="25"> </td> </tr> <tr> <td height="85" valign="top">Status </td> <td valign="top"> <textarea name="status" size="25"></textarea> </td> </tr> <tr> <td height="85" valign="top">Type </td> <td valign="top"> <textarea name="type" size="25"></textarea> </td> </tr> <tr> <td height="85" valign="top">Buy </td> <td valign="top"> <textarea name="buy" size="25"></textarea> </td> </tr> <tr> <td height="25" valign="top"></td> <td valign="top"><input type="submit" name="submit" value="Submit New Model!"></td> </tr> </table></form>
It still doesn't work. It says that you submitted something but for some reason it doesn't submit it to the database. Oh, my tables were screwed up, nevermind.
Add the following line to the top of the script: Code: error_reporting(E_ALL); Run it again and see what errors/warnings you get.