PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I need to create a Field in sql table based upon the time length. What length would you say would be safe to use? 10? 15? 20? without making it like 100 which would make it safe ^_^
10 is the maximum length of the values that the date() function can currently generate. (9999999999 = Monday, January 18th, 2038 - 8:14 pm). I usually use length 11 because I figure that should last long enough.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
if you store in a database, then by all means, don't save it as a string, because what is it you are going to store? time? integers, what size? 32bits... which leaves us with "int" as the datatype, unsigned. if you want to be thinking ahead then you are to use bigint (64bits I think).