从MySQL数据库中检索已保存的文本

I have a form that saves text into the MySQL database. The user does not need to register to save that form. How do I make it so that when someone submit's a form, it will display their text that THEY typed in a saved. I want it to be able to retrieve they're text that they submitted at that time and possibly give it a link like this: http://www.example.com/text115612 (the numbers are for different texts...) and make the retrieved text display on that page?

When the user submits the text, you can save the text together with an ID, in your example text115612.
After they've submitted, a server side script will redirect the user to the newly created text (Serverside, because the user can't predict what the ID will be).
If you wish to make the texts a little more private, you can make a harder ID so it's not possible for people to guess it.

What you need to do is retrieve the text and create new file with unique name

$userttext = $textfromdb  // get the user text
$file = fopen('text_file_name.txt','w') // open a new file
frwite($file,$textfromdb); // write to the file
fclose($file); // close the file




$link = "http://website.com/"."text_file_name.txt"; // create the website link

When user submits the form, you would do something like this.

//insert your text//
INSERT INTO table_name (text) VALUES ('text');

//get the primary key that was just inserted//
//column must be auto-increment//
$textid = SELECT LAST_INSERT_ID();

//you can also do this directly in PHP//
$textid = $mysqli->insert_id;

echo "http://www.example.com/" . $textid;