Thanks Karl,

Yes, I know.
My problem is how to fetch my $_POST['VALUES'], which is the
multi-dimensional  array:

myArray[0["id"]
 myArray[0]["name"]
 myArray[0]["description"]

myArray[1["id"]
 myArray[1]["name"]
 myArray[1]["description"]

myArray[2["id"]
 myArray[2]["name"]
 myArray[2]["description"]

etc.

Best regards,
Cor van Dooren


-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl
DeSaulniers
Sent: dinsdag 6 september 2011 3:54
To: Flash Coders List
Subject: Re: [Flashcoders] DataGrid: save multidim arrayfrom Flash to mySQL
with PHP

Hi Cor,
Assuming you know enough php to set up the file for connecting to your
database, you can insert into your database with the following example.

function addDescription($id, $name, $description) {
        //Escape any data being inserted
        $id = mysql_real_escape_string($id);
        $name = mysql_real_escape_string($name);
        $description = mysql_real_escape_string($description);

        $query = "INSERT INTO YOUR_TABLE_NAME_HERE VALUES ('".$id."','". 
$name."','".description."')";
        $_POST['VALUES'];

        $result = mysql_query($query, YOUR_CONNECTION) or
die(mysql_error());
        return $result; //Returns true or false if error }

HTH,
Best,

Karl


On Sep 5, 2011, at 2:04 PM, Cor wrote:

> I have a editable datagrid which I fill from mySQL with PHP.
> So far works good.
>
> But when items are changed (edit, added, deleted), I want them to save 
> the data in my mySQL database.
> My values are in this multi-dimensional indexed array, which elements 
> all contain a associative array:
>
> myArray[i]["id"]
> myArray[i]["name"]
> myArray[i]["description"]
>
> So, can anyone tell/show me a apropriate way to pass this to PHP and 
> in the php-file how to INSERT or UPDATE this to mySQL?
>
> TIA!
> Best regards,
> Cor van Dooren
>
>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Karl DeSaulniers
Design Drumm
http://designdrumm.com

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to