daveycockit Posted July 4, 2007 Share Posted July 4, 2007 //Index Calls class http://rafb.net/p/YIQLpD61.html // Class http://rafb.net/p/FuNdFP79.html // Example http://tinyurl.com/2x3a3o // u:p = test Hey guys, I am new here and i have been stuck on my script for a few days now. I have this set up so once they select a value from the drop down it will fill the col's with data from a SQL database. As soon as fill is pressed it should store the info into a multi-Dem array. However the problem i am having is that when you press fill it overwrites all the data in the array instead of adding the data into the array. I tried storing the array in sessions but i still have the same problem. Another issue i am having is that different sections of the forms get filled even though i assigned them to different vars in the index.php Please take a look at my code and example, Thanks for the help in advance! - Dave. Quote Link to comment Share on other sites More sharing options...
john010117 Posted July 4, 2007 Share Posted July 4, 2007 It'll be better if you posted the relevant part(s) of the code here, as I am not going to click those links. However, have you looked at array_merge() ? Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 4, 2007 Share Posted July 4, 2007 if array_push wont sort that prob then maybe you can try to use the idea of implode and explode Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 4, 2007 Share Posted July 4, 2007 Fill? Is fill an actually form button or link because your issue is probably that because the page is being reloaded (unless you using ajaxs) the array will of course rewrite and globalsl can't be arrays they are only strings. (at least I think) you would need to do some sort of foreach($myarray as $value) then insid e that foreach($value as $value2) (do this for each level) $_SESSION[$value2] = $value2 and then some how restructure the array on the next page but of course realitve code will show a simpler method Quote Link to comment Share on other sites More sharing options...
trochia Posted July 4, 2007 Share Posted July 4, 2007 Same as I... Here' you pull the pin on the hand grenade...while I watch Quote Link to comment Share on other sites More sharing options...
daveycockit Posted July 4, 2007 Author Share Posted July 4, 2007 Fill? Is fill an actually form button or link because your issue is probably that because the page is being reloaded (unless you using ajaxs) the array will of course rewrite and globalsl can't be arrays they are only strings. (at least I think) you would need to do some sort of foreach($myarray as $value) then insid e that foreach($value as $value2) (do this for each level) $_SESSION[$value2] = $value2 and then some how restructure the array on the next page but of course realitve code will show a simpler method The fill button is a form button. I will try to store the values into independent sessions. Thanks for the help. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 4, 2007 Share Posted July 4, 2007 what you are trying to do sounds bit complicated and you are outside the scope of php show us the realitve code/psedo code on what you are trying to do and maybe we can show you a much simpler solution. The variables die as soon as php is done executing as this flow chart shows End User sends request to given url php initalizes and executes its scripts all echoes are placed into the doc whereever they fall alll headers are initalized php stops execution other preypertext take over html processes and displays to end user on a form submit thie process happens all over from start with flushed variable values (i.e POST/GET are what ever their new values are all global declared/localized are void/!ISSET until declared in the new doc load) Quote Link to comment 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.