[eluser]Mareshal[/eluser]
I know MySQL can't and will never be like MongoDB, but following MongoDB's concept of being schema-less, I am building a library that should do the following:
Let's say you have no table create.
Executing the following code:
Code:
Dbm::insert('t3', array('fieldA' => rand()));
will result in:
1. create the table 't3' if not exists. If 't3' is created, the library also adds a 'id' field with autoincrement.
2. create fieldA if it doesn't exist in the table. If value from fieldA is numeric, fieldA will be INT(11), or if is string fieldA will be VARCHAR(255)
3. insert the data and return the insert_id
Same thing applies to update.
Please tell me what do you think.