PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi everyone I have two pages i would like to pass data between however the data i would like to pass is acually data that had been called from a mysql and automatically put into arrays as below
$sql_query = "SELECT * FROM base_data WHERE ParishName LIKE '$chooser'";
$result = mysql_query($sql_query,$conn) or die('Invalid query: ' . mysql_error());
$details = mysql_fetch_array($result);
Now i would like to use the same set of arrays in the next page, according to what was selected in the form How do i go about doing this I know i have to put a
but the only tutorials i can find tell you to define the arrays manualy which could be a long drawn out process.
Could someone please give me an example to work with so i can sort this out onc and for all
thanks in advance.
gpittingale wrote:Hi everyone I have two pages i would like to pass data between however the data i would like to pass is acually data that had been called from a mysql and automatically put into arrays as below
$sql_query = "SELECT * FROM base_data WHERE ParishName LIKE '$chooser'";
$result = mysql_query($sql_query,$conn) or die('Invalid query: ' . mysql_error());
$details = mysql_fetch_array($result);
Now i would like to use the same set of arrays in the next page, according to what was selected in the form How do i go about doing this I know i have to put a
but the only tutorials i can find tell you to define the arrays manualy which could be a long drawn out process.
Could someone please give me an example to work with so i can sort this out onc and for all
thanks in advance.
Well, $details is already an array. You can store it in the current session by doing
session_name('myname');
$session_start();
$details = $_SESSION['details'];
// at this point the array $details is available as if you had just fetched it.
...
just tryed what you said and for some reason it does not want to work? so hopefully youl get what i mean from this.....
here is the code for the head in the first page as you described