[PHP] Output Blank?

2008-06-23 Thread Dan Shirah
Having some issues with outputting my table data as an array. In the code below I am outputting the column titles of my table into an excel spreadsheet. I get the column titles just fine in Excel. if($numberFields) { // Check if we need to output anything $types = ifx_fieldtypes($query); if

Re: [PHP] Output Blank?

2008-06-23 Thread Daniel Brown
On Mon, Jun 23, 2008 at 1:46 PM, Dan Shirah [EMAIL PROTECTED] wrote: if($numberFields) { // Check if we need to output anything $types = ifx_fieldtypes($query); if (isset($types)) { foreach($types as $field_name[] = $data_type) { } } Is there a particular reason you're telling PHP

Re: [PHP] Output Blank?

2008-06-23 Thread Dan Shirah
When I have = $data_type in there my column title values for $field_name display correctly. If I take out = $data_type it displays the the column type. IE SQLNUMINT SQLCHAR...instead of the column title. On 6/23/08, Daniel Brown [EMAIL PROTECTED] wrote: On Mon, Jun 23, 2008 at 1:46 PM, Dan

Re: [PHP] Output Blank?

2008-06-23 Thread Dan Shirah
Is there a particular reason you're telling PHP that, for each $types variable, set this key of the $field_name array to equal $data_type, and do nothing else about it? The ifx_fieldtypes function returns the data as an array with the field names as the key, and the field types as the data.

Re: [PHP] Output Blank?

2008-06-23 Thread Jim Lucas
Dan Shirah wrote: Having some issues with outputting my table data as an array. In the code below I am outputting the column titles of my table into an excel spreadsheet. I get the column titles just fine in Excel. if($numberFields) { // Check if we need to output anything $types =

Re: [PHP] Output Blank?

2008-06-23 Thread Dan Shirah
AH HA! Got it! The problem was I did not need to loop through the array headers to associate the data. So I removed: foreach($field_name as $fieldName) { // Loop through the array of headers as we fetch the data $row[] = parseCSVComments($info-$fieldName); } // End loop And ran it as:

Re: [PHP] Output Blank?

2008-06-23 Thread Dan Shirah
// Initialize/clear the contents of the $row variable $row = array(); // You probably need to reset the $field_name var with each // iteration over it. from what I understand, foreach will move // the internal pointer of the array to the end. Then the