<i>Then you cannot write an app for it now can you? :-)</i>
Of course you can! Just use abstraction. All the script needs to know is that it's going to get some data, it can figure out what kind of data on it's own. If every app you wrote had to know EXACTLY what kind of data it's going to get at all times, well, it wouldn't be very flexable at all.
<i>This is getting stranger by the minute.
So now you are writing an app that will store it's data in "whatever is available"?</i>
No, I'm writing an app not un-like phpMyAdmin, but a little more dumbed down, for managers and other people to use where I work. I need to know the EXACT data type, for a few reasons, but the main reason is that some managers and users don't know SQL. They just want to insert what they want, not have to deal with ints and blobs and whatever. So the database takes care of that for them, by checking the type before it's written to the screen, and comparing the new value of the field to a set of pre-defined values, just incase the user tried to put 23523632623623623 into a TINYINT field.
<i>That's MySQL thinking again. The database knows what's wrong, and it will tell you. Don't try to outsmart the database.
But the real point is that if your app is anywhere near sane, it will never 'fail' to write, because you app already knows what types of data go in the database and it will give an error without ever touching the database.
With your method you must always do a describe query before you do a write query.
In the real world, 9 out of 10 inserts are successfull, so you'd do 10 describes and 9 inserts.
But if you just write and see if it fails, you do only one operation. that's 10 insert queries, of which one will fail. And if it fails because of 'illegal data' then it will probably come back faster than you can describe the table, parse the output and compare the data with the output. </i>
Well, you may be right about this, but I'm not trying to out smart the database. I'm trying to enforce a few rules, and check a few errors that will come up over and over, such as a user accidently changing the name and value of a primary field and thus fucking things up, because they're not suposed to do that.
I've got a few methods, that if something goes wrong with the query, it just spits out the mysql error message. I'm not trying to re-write the error checking code for all of the mysql functions!