Results 1 to 9 of 9

Threaded View

  1. #6
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: php arrays for inserting into one database field

    Quote Originally Posted by delia View Post
    Yup, and I've tried that - instead of the product model numbers it does Array,Array
    implode operates on a single dimensional array, such as in my example ;)

    Knowing the data set you need (and how it will be used / sent) would be useful... That way the data can be manipulated in the while loop to be in a complimentary format to the later use of the data...

    For example if you needed to send a csv of just model numbers... but wanted access to all fields later (and assuming model numbers are unique)...
    Code:
    $productsModelArray = array();
    while(!$productsQueryResult->EOF ) {
      $productsModelArray[$productsQueryResult->fields['products_model']] = $productsQueryResult->fields;
    
      $productsQueryResult->MoveNext();
    }
    $csvModelList = implode(',',array_keys($productsModelArray));
    Last edited by lhungil; 11 Sep 2013 at 02:40 PM.
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

 

 

Similar Threads

  1. v139b Database inserting into upgrade
    By Philibel in forum Upgrading to 1.5.x
    Replies: 2
    Last Post: 23 Feb 2013, 10:37 PM
  2. Inserting Referral field into invoice
    By blarney in forum Managing Customers and Orders
    Replies: 7
    Last Post: 4 Feb 2011, 09:18 AM
  3. Inserting a string into PHP
    By bhensarl in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 5 Nov 2010, 11:46 AM
  4. date problems inserting amazonpayments orders into database
    By AmazonPayments in forum Contribution-Writing Guidelines
    Replies: 8
    Last Post: 27 Aug 2010, 10:11 AM
  5. Inserting Code into tpl_header.php
    By drymetal in forum Templates, Stylesheets, Page Layout
    Replies: 37
    Last Post: 21 Jan 2010, 10:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg