Creating CFArray from MySQL Result Array
- by Andrew
Is there an easy way to dump an array returned from mysql_fetch_row into a CFArray? (part of the PHP implementation of CFPropertyList)
I'm bummed by the lack of documentation on CFPropertyList for PHP.
Iterating through each item in the array seems inefficient. I'm open to using a different mysql_fetch_... command.
I'd like to just say:
$NewArray = new CFArray( $ResultArray )
But that deosn't seem to work.
This is my current code:
$plist = new CFPropertyList();
$ResultRow = mysqli_fetch_row( $result );
$plist-add( $TableRow = new CFArray() );
foreach ( $ResultRow as $Item ){
$TableRow-add( new CFString( $Item ) );
}