As @Fred-ii- says, with the information you provide there is no way to provide a solution. However you can help yourself by changing your code to add some error reporting and also some status checking of the database accesses
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once("config.php");
$data = isset( $_POST['data'] ) ? $_POST['data'] : '';
if ( isset( $_POST['data'] ) ) {
$data = $_POST['data'];
$res = mysql_query("INSERT INTO `database` VALUES('$data')");
if ( ! $res ) {
echo mysql_error();
exit;
}
} else {
echo 'The data field was empty';
}
?>
Run this and you should receive at least one error to help you move forward.
Tell us what the error is and we will help if it is not obvious to you what is wrong.
Additional Note:
Please dont use the mysql_
database extensions, it is deprecated (gone for ever in PHP7)
Especially if you are just learning PHP, spend your energies learning the PDO
or mysqli_
database extensions,
and here is some help to decide which to use
It is also odd to call a table database
! A database is a collection of many tables. It will help you, and/or others later if you give your datbase tables sensible names that describe what data is being held in that table.
Also there is no reason why 2 lines inside a <textarea>
should not be stored in one column of your table.