Creating CFArray from MySQL Result Array

Posted by Andrew on Stack Overflow See other posts from Stack Overflow or by Andrew
Published on 2010-01-02T20:28:43Z Indexed on 2010/05/15 19:44 UTC
Read the original article Hit count: 153

Filed under:
|

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 ) ); }

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql