Jump to content

[SOLVED] Inserting into DB Prob.


fLaVV

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.