Quote:
Originally Posted by herkalurk
When you create a standard sql type database (mysql,mssql,oracle), you set structure around your data. So in the field for the gallery hash, I say that this field should be 5 characters long and a type of standard characters (letters numbers, etc). I did the same thing for my imagebam database. Since their gallery hash is 32 characters long that is the length allowed in that field in the database I made for that upload tool.
This gets into protecting your inputs, and data validation. If you were to have a field of only numbers you would limit it to only integer inputs so no one could accidentally put letters there.
|
That's all nice, but the Pixhost API guarantees only that the gallery hash is a string, not what length it has. Thus, storing it in a fixed-length datatype record is asking for trouble.
While I was looking closer at the API, I wondered why there are two different hashes in the first place and why they don't use a single long hash. Must be because they want to allow sharing galleries via Twitter, so the URL had better be short.