Jump to content

Recommended Posts

//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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/58348-solved-stuck-on-strange-array-error/
Share on other sites

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

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.

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)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.