Couple of Questions
Posted 24 February 2006 - 09:16 PM
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 = stripslashes($yourvar);
$data = fopen($filename, "w");
echo "File created!";
and it worked great. How would I create a FOLDER and then the file?
Posted 25 February 2006 - 12:53 PM
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.
Posted 25 February 2006 - 02:12 PM
So MySQL can take all syntax?
as long as you escape your string properly (using mysql_real_escape_string() or something similar), it can handle anything you put in there.
Posted 27 February 2006 - 08:54 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users