SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 28 of 28
  1. #26
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,139
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)
    I think the loop is your best bet because each value within that array needs to be assigned to a new memory slot. The only way to do that is to loop through it and assign each to a new position in a separate array. I've used eval() before to do the same thing your doing, but I think your solution is a much cleaner despite the additional loop.

  2. #27
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,139
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)

  3. #28
    SitePoint Zealot GOPalmer's Avatar
    Join Date
    Jan 2009
    Location
    Wiltshire, UK
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see what you were doing. As much as i hate eval i have a feeling some thing like this will solve my problem.

    PHP Code:
        private function _bindResult()
        {
            
    $this->_metaData $this->_statement->result_metadata();
            while (
    $field $this->_metaData->fetch_field()) {
                
    $this->_fieldParams[] = $field->name;
            }
            
            
    $arguments $this->_fieldParams;
            
    $arguments implode('\'], $this->_fieldRow[\''$arguments);
        
            
    $evil '$this->_statement->bind_result($this->_fieldRow[''.$arguments.'\']);';
            
            eval(
    $evil);

        } 
    Its really not the route im happy to take though.

    Thanks for all you help. I think i'll just have to live with that extra loop.

    Best Regards, George


Bookmarks

Posting Permissions

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