1

I want to store php code in Mysql database and I am wondering which data type I can use. I will store large amount of data with special characters like ",*,$ etc.

So which mysql data tpye I can use?

//Why? See My other question

5
  • 8
    The best MySQL data type for PHP code is CHAR(0). :-/ Commented Aug 10, 2011 at 15:42
  • 1
    Well, you looked at Data Types and decided on what? -1 for no apparent research. Commented Aug 10, 2011 at 15:42
  • 6
    why you want to store php code in mysql? Commented Aug 10, 2011 at 15:43
  • 2
    special characters don't have any influence on the chosen datatype. use proper escaping and you should be set. Commented Aug 10, 2011 at 15:45
  • Why? See link ... Commented Aug 10, 2011 at 15:52

2 Answers 2

2

Use a TEXT column, if there is to be more than just a few characters of code stored.

Sign up to request clarification or add additional context in comments.

Comments

1

Use TEXT .. but if you ever want to use eval(), rethink about storing code in db..

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.