How to create a new record via api
Posted: Tue Apr 20, 2010 8:52 am
Hi,
System: win7 server, xampp for mysql, apache and php 5.3.1 + xataface version which works.
The database and xataface front end are working fine and I have been developing a basic gui environment using xataface to work with.
I am using xataface as one half of a web system and my code needs to manipulate the data in the database. I could code up my proprietay system to access the database, change records, add new ones, etc, but xataface obviously has these so I am planning to create applications which will use the api to do all the tasks.
I can find api examples and code to do everything I need apart from to add a new record and populate it with information.
I can see that the add record button on xataface uses an action to create a new record in table X.
Can I use this action to add the new data at the same time? Or can I pick up the id for the new record, find it and get my code to add the data, then update?
It seems like something everyone would need to do, but I can't find any examples on the web which work.
A working code example of how to use php to do this would be such a help!
System: win7 server, xampp for mysql, apache and php 5.3.1 + xataface version which works.
The database and xataface front end are working fine and I have been developing a basic gui environment using xataface to work with.
I am using xataface as one half of a web system and my code needs to manipulate the data in the database. I could code up my proprietay system to access the database, change records, add new ones, etc, but xataface obviously has these so I am planning to create applications which will use the api to do all the tasks.
I can find api examples and code to do everything I need apart from to add a new record and populate it with information.
I can see that the add record button on xataface uses an action to create a new record in table X.
Can I use this action to add the new data at the same time? Or can I pick up the id for the new record, find it and get my code to add the data, then update?
It seems like something everyone would need to do, but I can't find any examples on the web which work.
A working code example of how to use php to do this would be such a help!