stevieontario Posted May 3, 2009 Share Posted May 3, 2009 Hello php experts: I have gone through a 124-element array (converted from an xml file using simplexml_file_load) and I can now output 124 lines of information, with 4 items on each line. I now want to put the contents of each line into a separate database table, i.e., I will have 124 database tables. Racking my brain to figure it out, but I'm stumped. Any ideas? I'm using PHP Version 5.2.8 Quote Link to comment https://forums.phpfreaks.com/topic/156660-picking-results-of-an-array-walk-through-help/ Share on other sites More sharing options...
Daniel0 Posted May 3, 2009 Share Posted May 3, 2009 When iterating over the array, just insert the rows as you go. Quote Link to comment https://forums.phpfreaks.com/topic/156660-picking-results-of-an-array-walk-through-help/#findComment-824911 Share on other sites More sharing options...
mattal999 Posted May 3, 2009 Share Posted May 3, 2009 Something like this?: <?php foreach ($xmlarray as $value) { //Insert query using $value as string record } ?> Quote Link to comment https://forums.phpfreaks.com/topic/156660-picking-results-of-an-array-walk-through-help/#findComment-824919 Share on other sites More sharing options...
gevans Posted May 3, 2009 Share Posted May 3, 2009 I have no idea what you're doing, but do you really want to have 124 tables containing (what I would imageine is) similar data? Quote Link to comment https://forums.phpfreaks.com/topic/156660-picking-results-of-an-array-walk-through-help/#findComment-824946 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.