fLaVV Posted June 22, 2007 Share Posted June 22, 2007 I get no errors, but when I click submit, the information doesnt show up in the database. <? if($_POST['submit']){ include("db.php"); $name = $_POST['name']; $serial = $_POST['serial']; $info = $_POST['info']; $style = $_POST['style']; $view = $_POST['view']; $download = $_POST['dlink']; $image = $_POST['vlink']; mysql_query("INTERT into serach_templates (id, name, serial, info, style, view, download, image)". "VALUES ('NULL', '$name', '$serial', '$info', '$style', '$view', '$download', '$image')"); echo "Results entered!"; } else { ?> <form action="addtemplate.php" method="post"> <table width="433" border="0" cellpadding="0" cellspacing="0"> <tr> <td>Template Name:</td> <td> <input type="text" name="name" id="name" /></td> </tr> <tr> <td>Template Serial:</td> <td> <input type="text" name="serial" id="serial" /></td> </tr> <tr> <td>Information:</td> <td> <textarea name="info" id="info" cols="45" rows="5"></textarea></td> </tr> <tr> <td>Image URL:</td> <td> <input type="text" name="url" id="url" /></td> </tr> <tr> <td>Download Link:</td> <td> <input type="text" name="dlink" id="dlink" /></td> </tr> <tr> <td>View Link</td> <td> <input type="text" name="vlink" id="vlink" /></td> </tr> <tr> <td>Style:</td> <td><select name="style" id="style"> <option selected="selected">--Select Style --</option> <option value="clean">Clean</option> <option value="dark">Dark</option> <option value="light">Light</option> <option value="futuristic">Futuristic</option> <option value="vector">Vector</option> <option value="retro">Retro</option> </select></td> </tr> <tr> <td> </td> <td><div align="center"> <input type="submit" name="submit" id="submit" value="Enter Info" /> </div></td> </tr> </table> </form> <? } ?> Any suggestions? Link to comment https://forums.phpfreaks.com/topic/56767-solved-inserting-into-db-prob/ Share on other sites More sharing options...
cooldude832 Posted June 22, 2007 Share Posted June 22, 2007 add to your query or die(mysql_error()); and tell us what it says Link to comment https://forums.phpfreaks.com/topic/56767-solved-inserting-into-db-prob/#findComment-280347 Share on other sites More sharing options...
fLaVV Posted June 22, 2007 Author Share Posted June 22, 2007 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTERT into serach_templates (id, name, serial, info, style, view, download, ima' at line 1 Link to comment https://forums.phpfreaks.com/topic/56767-solved-inserting-into-db-prob/#findComment-280350 Share on other sites More sharing options...
chigley Posted June 22, 2007 Share Posted June 22, 2007 INTERT -> INSERT Link to comment https://forums.phpfreaks.com/topic/56767-solved-inserting-into-db-prob/#findComment-280353 Share on other sites More sharing options...
cooldude832 Posted June 22, 2007 Share Posted June 22, 2007 good call on that, but as a rule of thumb add the or die before you come here Link to comment https://forums.phpfreaks.com/topic/56767-solved-inserting-into-db-prob/#findComment-280354 Share on other sites More sharing options...
fLaVV Posted June 22, 2007 Author Share Posted June 22, 2007 Omg...i feel like such a n00b now.../cry...thanks for the fast replys didnt mean to bother u all with such a stupid error...Really am sorry, but thanks again. Thanks cooldude, your name says it all ...Yea i dont know why I didnt put that in..also thank you chigley for proving that i cant spell...but now I know to make sure i spell INSERT and not INTERT Link to comment https://forums.phpfreaks.com/topic/56767-solved-inserting-into-db-prob/#findComment-280358 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.