I have a dynamic werbservice that I was unable to find a way to bind the
variables in mysqli, the default for Flex webservices, but was able to find
a nice solution to using PDO.  The problem I have run into is that PDO does
not seem to have a bind_result function like mysqli.  So the problem is that
I am unable to find a clean way to set my return values from the webservice
in Flex.  It is just returning an object.  So in PDO, I am doing this:

$result = $stmt->fetchAll(PDO::FETCH_ASSOC);            
return $result;

I assumed this would return an array, as that is how it traces out in PHP,
but it is instead returning what Flex sees as an object.  In mysqli, we do
this:

while (mysqli_stmt_fetch($stmt)) {
    $rows[] = $row;
    $row = new stdClass();
    mysqli_stmt_bind_result($stmt, $row->MLSNum, $row->latitude,
$row->longitude);
}

As a result, MLSNum, latitude, and longitude can all be given a datatype in
Flex individually.  Is there a way I should return the data in PDO so that I
am able to send back an array with datatypes instead of an object?

Thanks for any insight!



--
View this message in context: 
http://apache-flex-users.2333346.n4.nabble.com/PDO-vs-mysqli-Web-Service-Return-Values-tp14970.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Reply via email to