nine72 Posted September 2, 2008 Share Posted September 2, 2008 Hi everyone, Just a question if you will... I have a set of forms (8 to be exact) I am saving the field data to the session, then generating a massive, very complex XML string based on the data in the session. EXP...for simplest part of the xml build. $xmlString .= "<Corporate>\n"; $xmlString .= "<CpBus>\n"; $xmlString .= "<agent_id>". $agentId ."</agent_id>\n"; $xmlString .= "<iso_id>". $isoId . "</iso_id>\n"; $xmlString .= "<bb_id>". $bbId . "</bb_id>\n"; $xmlString .= "<cp_legal_name>". $cpLegalName . "</cp_legal_name>\n"; $xmlString .= "<cp_dba_name>". $cpDbaName . "</cp_dba_name>\n"; $xmlString .= "</CpBus>\n"; $xmlString .= "</Corporate>\n"; Moving forward I do not want to save to the session as I need 3 of the forms to be able to be used over and over by the user as many times as needed. Therefore, I am now committing the data to a mysql temp db. At the point I want to build my XML string I want to pull the information from the tables and place into a session, just long enough to build the string. The session build needs to look something like this: $_SESSION['column_name'] = $val_of_cell; So I am thinking that it should be as simple as... include_once("../../Connections/bdadd.php"); // Location of my db connection script include_once("../../db_calls/get_session.php"); // Location of my query to get table data. $xmlSet = 'SELECT * FROM table_name' $query = ($xmlSet); $res = mysql_query($query); if($res){ while($row = mysql_fetch_assoc($res)){ foreach($row as $key => $val){ $_SESSION[$key] = ($val); } } } Change to the xml generation would be something like… $xmlString .= "<Corporate>\n"; $xmlString .= "<CpBus>\n"; $xmlString .= "<agent_id>". $agentId ."</agent_id>\n"; $xmlString .= "<iso_id>". $isoId . "</iso_id>\n"; $xmlString .= "<bb_id>". $bbId . "</bb_id>\n"; $xmlString .= "<cp_legal_name>". $cpLegalName . "</cp_legal_name>\n"; $xmlString .= "<cp_dba_name>". $cpDbaName . "</cp_dba_name>\n"; $xmlString .= "</CpBus>\n"; $xmlString .= "</Corporate>\n"; To accommodate the session set up. However, when I try and test this theory by doing a echo "<pre>"; print_r(session_id()); print_r("\n"); print_r($_SESSION); echo "</pre>"; I get the session_id but none of the data from the table.... Does anyone have any thoughts, theories or suggestions? Thanks Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted September 2, 2008 Share Posted September 2, 2008 What is: $query = ($xmlSet); ? Quote Link to comment Share on other sites More sharing options...
nine72 Posted September 2, 2008 Author Share Posted September 2, 2008 my query statement, held on an include page... $xmlSet = 'SELECT * FROM table_name' 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.