PDA

View Full Version : Data FROM datagrid to MySQL


orenot
08-23-2005, 02:56 PM
I have no problems populating a datagrid from both the database and user entry. What I am confused is how to then go back to the datbase! I have been unable to find any examples of how to insert/update values in a database (mysql) with values from a datagrid.

I can use amfphp or PHPObject to talk to php and then mysql. I just don't understand the best method (best meaning easiest :) ) to do this.

TIA for any pointers

orenot
08-26-2005, 03:09 PM
Ok, I found this. Maybe is will help a bit.
http://www.flash-db.com/Tutorials/miniboard/

BUT it doesn't really give good info on how to submit the whole datagrid for insert as opposed to just one new row....

Anyone??? Help?

Hads
09-01-2005, 03:37 AM
I do this using coldfusion and flash remoting, but I assume that it would be similar using amfphp.

var rs:Service = new Service(....);
var sa:Array = new Array();
for(var i=0; i<myGrid_grid.length; i++) {
sa["somevar"] = myGrid_grid.getItemAt(i).somevar
sa["somevar2"] = myGrid_grid.getItemAt(i).somevar2
var pc:PendingCall = rs.amfphpfunc(sa);
}

I hope this helps

orenot
09-01-2005, 06:55 AM
Thanks.