The question should be clear, but I'll explain once more: I'm trying to insert the individual values from an array in a mysql database.
Here is the code:
public function addRoute($pointArray){
$length = 4; //just to be sure that nothing went wrong with calulating the length
for($i = 0; $i < $length; $i++){
$result = "INSERT into route_point(latlng, routeID) VALUES (4849, 10)"; //sample values, to once again be sure that there is nothing wrong with the values
mysql_query($result);
}
mysql_close(); //just to be sure again
return true;
}
The pointArray is being passed from actionscript using the zendamf framework if anyone is wondering. In my eyes nothing is wrong with the statement, but instead of inserting 4 rows, it inserts more than 100 000 rows.. I also don't receive the "true" back in actionscript, which should be passed when the php function is executed.
I also tried a for each loop, but I get an error (which I can't read since i'm calling the php file from actionscript).
foreach ($pointArray as $value) {
$result = "INSERT into route_point(latlng, routeID) VALUES ('$value', 10)";
mysql_query($result);
}
I prefer to use a for loop though.
Absolutely clueless on this, fiddled with several settings for a couple of hours now.
arr[500] = 1
in AS, and then send it out via AMF or JSON or whatever, the output data will be built with array elements 1 through 499 defined as well, not just #500, so you're sending 500 elements, not 1. – Marc B Dec 25 '10 at 4:37$server->setProduction(!DEBUG)
on the Zend_Amf_Server instance. – eswald Aug 14 at 19:18