creating your db.xml file - guide and cheat sheet1 user found helpful
but this link not works!
Try this link:
you (or anyone else) don't happen to know if references are supported and applied accordingly in the adodb used in c5? and if so, how you would actually define them?
How do you create an entry for a Decimal as 6 digits and 2 decimal places in the XML schema?
I've been Googling now for hours looking for a good reference that shows all the portable data type codes and examples on how to use each and every one of them in a db.xml file. I find that even ADOdb's website is lacking in explanation especially when it comes to axmls
w.r.t your problem, as an example, you can do
field name="my_number" type="N" size="10.6"
The number spec is similar to numbers in format strings. The above is 10 digits with 6 after the decimal point.
I can't remember or find where I originally dug that out from :(
You still need validation in PHP before attempting to save to such a field or you will get mySQL errors when users provide data that does not fit. In general, I find the most reliable strategy is to be more relaxed about the database and very strict in the PHP that prepares data for saving.
I concur with your strategy, do all data filtering and manipulation with php and the database is for storage, sorting, and collating.
I went ahead to create my db.xml file placing the attribute, size="6.2" to store prices but I wasn't sure whether this was correct or not. I am still working on the first block creation. I surmised this was correct because I am specifying a size for this field even though in the earlier documentation explaining how to specify it's structure when calling an ADOdb method they show the structure as part of the data type, 'N(6.2)'.
Another thing that documentation is laking for AXMLS is that there are a lot more data types available for SQL but the list of portable type codes is missing a lot. For instance, There are a lot more Char and string types than the "varchar", yet the varchar is the only one represented in the portable type codes list. How do I implement other types in the db.xml file. It would be great if someone that has good knowledge of AXMLS would write a complete reference for creating a db.xml file including a complete reference with examples of every attribute and data type that can be used and their implementation.
I started another thread yesterday, "What is the best approach for creating a DB", that has more to do with what I am trying to achieve. I landed here on this thread while looking for answers. This discussion is based on another c5 posting which is just an iteration of phplens.com's incomplete work on ADOdb.