i think there is no "largetext" type in MySQL. Try "longtext" instead.
If using phpmyadmin SQL sentences to insert the table make sure you write:
CREATE TABLE `data`
Summing up: the following sentences don't cause any error and the record inserts correctly:
mysql_query ("CREATE TABLE data (id mediumint(8) NOT NULL auto_increment,user_data longtext NOT NULL,time int(11) DEFAULT '0' NOT NULL,PRIMARY KEY (id));",$link);
mysql_query( "INSERT INTO data ( user_data, time ) VALUES ( '$raw_data', '$time' )",$link );