Jump to content

Help with mysql error...


Recommended Posts

ok here's the bit of code for adding a new news post:

 

function addnews() {

   

    if (isset($_POST["submit"])) {

       

        extract($_POST);

        $errors = 0;

        $errorlist = "";

        if ($content == "") { $errors++; $errorlist .= "Content is required.<br />"; }

       

        if ($errors == 0) {

            $query = doquery("INSERT INTO {{table}} SET id='',postdate=NOW(),content='$content'", "news");

            admindisplay("News post added.","Add News");

        } else {

            admindisplay("<b>Errors:</b><br /><div style=\"color:red;\">$errorlist</div><br />Please go back and try again.", "Add News");

        }       

       

    }

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.