I'm trying to add a new row in a wordpress table (that i've created), but every times that i add the new row, all the others are deleted and if i look DB table i can see only last inserted row.
I've tried two methods, but i get the same results:
$ins_reply = $wpdb->insert( $table, array('itemid'=> $item_id, 'time' => $time, 'title' => '', 'text' => $content, 'author' => $user, 'deadline' => 0));
OR
$query_insert = "INSERT INTO ".$table." (`itemid` ,`time` ,`title` ,`text` ,`deadline` ,`author`) VALUES ('".$item_id."', '".$time."', '', '".$content."', '0', '".$user."')";
$wpdb->query($query_insert);
What's wrong in my code?