lpxxfaintxx Posted February 24, 2006 Share Posted February 24, 2006 I was wondering, for MySQL there are many data types.[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]CHAR( ) A fixed section from 0 to 255 characters long.VARCHAR( ) A variable section from 0 to 255 characters long.TINYTEXT A string with a maximum length of 255 characters.TEXT A string with a maximum length of 65535 characters.BLOB A string with a maximum length of 65535 characters.MEDIUMTEXT A string with a maximum length of 16777215 characters.MEDIUMBLOB A string with a maximum length of 16777215 characters.LONGTEXT A string with a maximum length of 4294967295 characters.LONGBLOB A string with a maximum length of 4294967295 characters.[/quote]Which is best suited for storing PHP coding and/or any type of programming language? Ex: A site that provides AIM profiles to users. When the user saves their settings, the code gets processed, stored into MySQL, and makes a folder named after the user, and creates the actual file (user329/index.php, etc). Will it even store special characters, (such as $, <, >, *, &, ^, etc) or will I have to do something fancy?2) In my previous PHP project, I used the code <?$filename = $_GET["fname"];$yourvar= $_GET["content"];$yourvar = stripslashes($yourvar);$data = fopen($filename, "w");fwrite($data,$yourvar);fclose($data);echo "File created!";?> and it worked great. How would I create a FOLDER and then the file? -Thanks <3 Quote Link to comment https://forums.phpfreaks.com/topic/3578-couple-of-questions/ Share on other sites More sharing options...
wildteen88 Posted February 25, 2006 Share Posted February 25, 2006 mediumtext or longtext should statisfy your needs.with your secound quesion you can use a function called [a href=\"http://uk2.php.net/manual/en/function.mkdir.php\" target=\"_blank\"]mkdir[/a] which will attempt to create a folder for you. Quote Link to comment https://forums.phpfreaks.com/topic/3578-couple-of-questions/#findComment-12418 Share on other sites More sharing options...
lpxxfaintxx Posted February 25, 2006 Author Share Posted February 25, 2006 So MySQL can take all syntax? Quote Link to comment https://forums.phpfreaks.com/topic/3578-couple-of-questions/#findComment-12420 Share on other sites More sharing options...
obsidian Posted February 25, 2006 Share Posted February 25, 2006 [!--quoteo(post=349292:date=Feb 25 2006, 08:30 AM:name=lpxxfaintxx)--][div class=\'quotetop\']QUOTE(lpxxfaintxx @ Feb 25 2006, 08:30 AM) [snapback]349292[/snapback][/div][div class=\'quotemain\'][!--quotec--]So MySQL can take all syntax?[/quote]as long as you escape your string properly (using mysql_real_escape_string() or something similar), it can handle anything you put in there. Quote Link to comment https://forums.phpfreaks.com/topic/3578-couple-of-questions/#findComment-12421 Share on other sites More sharing options...
lpxxfaintxx Posted February 27, 2006 Author Share Posted February 27, 2006 Can you give me more insight on that? Thanks, I'm trying to store PHP codes into MySQL. Quote Link to comment https://forums.phpfreaks.com/topic/3578-couple-of-questions/#findComment-12831 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.