Good time of day! My question is the following: a table is created, from 2 fields, the type of the first field is char , and I would like to know the type of the second. It is necessary to make it so that it loads information from a text file located on the D drive under the name 1.txt . What type of field should I choose and which command should I register?! Thank.

    3 answers 3

     `myText` text NOT NULL default '', 

      In addition to TEXT, you can also take the BLOB type and load the entire files there.

         <form method="POST" enctype="multipart/form-data" action="readfile.php">FILE<input type="file" name="file"><input type="submit"></form> 

        This is HTML .

         <?php $tmp=$_FILES['file']['tmp_name']; $name=$_FILES['file']['name']; move_uploaded_file($tmp, "uploads/".$name); $handle = fopen("uploads/$name", "r"); while (!feof($handle)) { $buffer = fgets($handle, 4096); echo $buffer; } ?> 

        And this is PHP (readfile.php) . It seems everything works :-))

        It remains to throw the contents of $buffer in the database.