Notice: Undefined index: post_catagory in /Users/darceymckelvey/Desktop/php/includes/classinsert.php on line 9
Notice: Undefined variable: category in /Users/darceymckelvey/Desktop/php/includes/classinsert.php on line 13
The code:
<?php
  require_once('classdb.php');
  if(!class_exists('INSERT')){
    class INSERT {
      public function post($postdata){
        global $db;
        $catagory = serialize($postdata['post_catagory']);
        $query = "
                  INSERT INTO posts(post_title, post_content, post_category)
                  VALUES ('$postdata[post_title]', '$postdata[post_content]', '$category')
              ";
        return $db->insert($query);
      }
    }
  }
  $insert = new INSERT;
?>
Issue:
The outputted result is the post_title and post_content working but the post_category not at all and is left blank.
 
     
     
    