Converting recordset into array

A place for users and developers of the Xataface to discuss and receive support.

Converting recordset into array

Postby wisni1rr » Wed Apr 04, 2012 10:03 am

I have a custom function to calculate the median of an array. I need help to convert all of a certain field in a found set to an array as used in the following code snippet.
It would be best to somehow use an if statement to convert to an array as in the case of:

Code: Select all
if ($record->val('FieldB') == "string"){
             Add $record->val('FieldB') to array


to use in place here:

Code: Select all
include ("ajstatistics.php");
$a = array(0, 1, 2, 3, 4, 5);

$the_median = median($a);


Thanks for all of your help!
wisni1rr
 
Posts: 107
Joined: Mon Feb 13, 2012 9:03 pm

Re: Converting recordset into array

Postby jvinolas » Thu Apr 05, 2012 12:43 am

I don't know if I understand what you want to do, but maybe this will help you (mysql fetch array):
http://www.tizag.com/mysqlTutorial/mysqlfetcharray.php
jvinolas
 
Posts: 51
Joined: Thu Apr 15, 2010 12:31 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 18 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved