Hi Cor,
On Sep 5, 2011, at 11:14 PM, Cor wrote:
Karl,
Thank you very much!!
But this would create a lot of network traffic, open connection and
database, do mysql_query and close db conn??
You only need to open it once. Do all your sending and inserting, then
close once your done.
You wrote in the previous mail:
I should mention that I use this stuff inside php classes. so $this-
> has
already been defined as the class your currently in.
Like the database class, $database->addDescription(); is called
outside the
class. if it was called inside the database class file, it would be
$this->addDescription();. Also, the php file name thats called from
flash is
database.php. etc, etc. FYI.
- a process.php, this retrieves your variables from flash, makes
sure its
not a bot, any verify codes checked here, etc
- then send it to your sessions.php for validation and set your
errors here
to send back with.
- then send to your database.php for stripping, manipulation and
insertion.
This is what I am looking for (to learn) and where my knowledge of PHP
stops...
This is the best way in my opinion. I learned off of finding a php
login example.
You can address me directly if you like: codo AT chello DOT nl
I am available if you need. My email is above.
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 6:07
To: Flash Coders List
Subject: Re: [Flashcoders] DataGrid: save multidim arrayfrom Flash
to mySQL
with PHP
I think you may be able to use the php split() or explode() on a
array of
data sent.
but probably easier to split it up when gathering the info in flash.
multiple small queries instead of a bulky single query?
Karl
On Sep 5, 2011, at 10:34 PM, Cor wrote:
Do you mean that is it not possible to send an array from Flash to
PHP
in this way:
private function validateAndSend(e:MouseEvent):void {
form_variables = new URLVariables();
form_varSend=new URLRequest(Main.PHP_URL+"control.php");
form_varSend.method=URLRequestMethod.POST;
form_varSend.data=form_variables;
form_varLoader=new URLLoader ;
form_varLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
form_variables.sendRequest = "registreer_materiaal";
form_variables.VALUES = myMultiDimArray;
form_varLoader.addEventListener(Event.COMPLETE,
completeLoadHandler);
form_varLoader.load(form_varSend);
}
-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Dave
Watts
Sent: dinsdag 6 september 2011 5:27
To: Flash Coders List
Subject: Re: [Flashcoders] DataGrid: save multidim arrayfrom Flash to
mySQL with PHP
My problem is how to fetch my $_POST['VALUES'], which is the
multi-dimensional array:
myArray[0["id"]
myArray[0]["name"]
myArray[0]["description"]
...
etc.
I'm not a PHP expert, but in general you can't really submit an array
as form data directly to a CGI program. You have to post name-value
pairs - if you have a set of array values, they'd simply end up
having
the same name and different values (like a checkbox array in HTML,
for
example).
In your
case, things are a bit more complicated because you have an array of
structs, basically, so you'll need to convert those to a bunch of
individual name-value pairs in order to submit them to a CGI program.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/
Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA
Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.
_______________________________________________
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
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
Karl DeSaulniers
Design Drumm
http://designdrumm.com
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders