Jump to content

Couple of Questions


lpxxfaintxx

Recommended Posts


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

Link to comment
Share on other sites

[!--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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.