what coluld cause this->Column count doesn't match value count at row 1

Class:

    function add_content($p){

        $title = mysql_real_escape_string($p['title']);
        $body = mysql_real_escape_string($p['body']);

        if(!$title || !$body):

            if(!$title):
                echo "<p>The Title is required!</p>";
            endif;
            if(!$body):
                echo "<p>The body is required!</p>";
            endif;

            echo '<p><a href="add_content.php">Try again!</a></p>';
        else:
            $sql = "INSERT INTO content VALUES(null, '$title', '$body')";
            $res = mysql_query($sql) or die(mysql_error()); 
            echo "added Successfuly";
        endif;
    }

When inserting records you don't need a value for the id so your query should just be

 $sql = "INSERT INTO content VALUES('$title', '$body')";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.