Hi, first I want to say thanks for the help I received here over a year ago with a perplexing issue that I had. The advise was fantastic and helped a lot.
Today I have another issues that I can not seam to get past or figure out and hope that the community here will be able to assist me in getting past this next mile stone in my current project.
Overview…
8 forms all data being temp store in a mysql db.
After they have filled in the forms I am generating a very large and complex XML string from the data in the db by doing the following…
[PHP]<?PHP
//Open Includes for page information.
include_once(". ./../gatewayapi/inc_gatewayapi. php");
include_once(". ./../Connections/conn.php");
include_once(". ./../db_calls/get_db_var.php" );
$query = ($xmlVarSet);
$res = mysql_query($qu ery);
if($res){
while($row = mysql_fetch_ass oc($res)){
foreach($row as $key => $val){
$_SESSION['db'][$key] = ($val);
}
}
}
?>[/PHP]
This is doing a fantastic job of getting the data an putting it into the named session and filling in the values for my XML String.
My issue is now that 3 of the forms can be used multiple times so I need to some how take the above and rework it to look at a specific table count the number of rows were there is a unique identifier for the users session and then loop them through a block of my XML Code.
Example:
[PHP]<?PHP
//Open Includes for page information.
include_once(". ./../gatewayapi/inc_gatewayapi. php");
include_once(". ./../Connections/jpbdadd.php");
include_once(". ./../db_calls/get_session.php ");
// NEED HELP HERE!!
$query = ($xmlTtVarSet);
$res = mysql_query($qu ery);
if(!$res){
die(mysql_error ());
}
$num = mysql_num_rows( $res);
$i=0;
while ($i < $num) {
//code to run
$xmlString .= "<Kiosks>\n ";
$xmlString .= "<Kiosks>\n ";
$xmlString .= "<KiBus>\n" ;
$xmlString .= "<tt_legal_name >" . $ttLegalName . "</tt_legal_name>\ n";
$xmlString .= "<tt_dba_na me>" . $ttDbaName . "</tt_dba_name>\n" ;
$xmlString .= "<device_ty pe>" . "KOS" . "</device_type>\n" ;
if (ttDynmcDesc != "") {
$xmlString .= "<dynamic_descr iption>" . $ttDynmcDesc . "</dynamic_descrip tion>\n”; }
if $ttPosCd != "") {
$xmlString .= "<pos_code> " . $ttPosCd . “</pos_code>\n";
}
if ($ttStandIn != "") {
$xmlString .= "<standin>" . $ttStandIn . “</standin>\n";
}
if ($ttTmZone != "0") {
$xmlString .= "<time_zone >" . $ttTmZone . “</time_zone>\n";//
}
if ($ttDupChk != "") {
$xmlString .= "<duplicate_che cking>" . $ttDupChk . “</duplicate_check ing>\n";//
}
if ($ttChrgDesc != "") {
$xmlString .= "<charge_descri ption>" . $ttChrgDesc . “</charge_descript ion>\n";
}
if ($ttHubFlg != "") {
$xmlString .= "<hub_flag> " . $ttHubFlg . “</hub_flag>\n";// currently used only for DFW WinHub
}
if ($ttAltCityDisc != "") {
$xmlString .= "<tt_alt_city_d escriptor>" . $ttAltCityDisc . “</tt_alt_city_des criptor>\n";
}
$xmlString .= "</KeiBus>\n";
$xmlString .= "<KiEquipments> \n";
$xmlString .= "<KiEquipment>\ n";
if ($ttSerialNo != "") {
$xmlString .= "<device_serial _no>" . $ttSerialNo . “</device_serial_n o>\n";
}
if ($ttDevEsn != "") {
$xmlString .= "<device_es n>" . $ttDevEsn . “</device_esn>\n";
}
if ($ttDevMann != "") {
$xmlString .= "<device_ma nn>" . $ttDevMann'] ."</device_mann>\n" ;
}
if ($ttDevSim != "") {
$xmlString .= "<device_si m>" . $ttDevSim . “</device_sim>\n";
}
if ($ttAddInfo != "") {
$xmlString .= "<device_additi onal_info>" . $ttAddInfo . “</device_addition al_info>\n";
}
if ($ttDevPbx != "") {
$xmlString .= "<device_pb x>" . $ttDevPbx'] ."</device_pbx>\n";
}
$xmlString .= "<device_catego ry>" . "KIOSK" . "</device_category >\n";
if ($ttDevName != "") {
$xmlString .= "<device_na me>" . $ttDevName . “</device_name>\n" ;
}
if ($ttDevMod != "") {
$xmlString .= "<device_model> " . $ttDevMod . “</device_model>\n ";
}
if ($ttDevAppType != "") {
$xmlString .= "<device_applic ation>" . $ttDevAppType . “</device_applicat ion>\n";
}
if ($ttGateWay != "") {
$xmlString .= "<device_gatewa y>" . $ttGateWay . “</device_gateway> \n";
}
if ($ttDevCommFmt != "") {
$xmlString .= "<device_comm_f ormat>" . $ttDevCommFmt . “</device_comm_for mat>\n";
}
if ($ttDialUp != "") {
$xmlString .= "<device_dial_u p>" . $ttDialUp . “</device_dial_up> \n";
}
$xmlString .= "<device_fl ag>" . "N" . "</device_flag>\n" ;
$xmlString .= "</KiEquipment>\n" ;
$xmlString .= "</KiEquipments>\n ";
$xmlString .= "</Kiosk>\n";
$xmlString .= "</Kiosks>\n";
$i++;
}
//Print results to page.
echo "<pre>";
print_r($xmlStr ing);
echo "</pre>";
?>[/PHP]
So that’s it, any direction, examples, thoughts, re-work, would be most helpful
Thanks
Nine72
Today I have another issues that I can not seam to get past or figure out and hope that the community here will be able to assist me in getting past this next mile stone in my current project.
Overview…
8 forms all data being temp store in a mysql db.
After they have filled in the forms I am generating a very large and complex XML string from the data in the db by doing the following…
[PHP]<?PHP
//Open Includes for page information.
include_once(". ./../gatewayapi/inc_gatewayapi. php");
include_once(". ./../Connections/conn.php");
include_once(". ./../db_calls/get_db_var.php" );
$query = ($xmlVarSet);
$res = mysql_query($qu ery);
if($res){
while($row = mysql_fetch_ass oc($res)){
foreach($row as $key => $val){
$_SESSION['db'][$key] = ($val);
}
}
}
?>[/PHP]
This is doing a fantastic job of getting the data an putting it into the named session and filling in the values for my XML String.
My issue is now that 3 of the forms can be used multiple times so I need to some how take the above and rework it to look at a specific table count the number of rows were there is a unique identifier for the users session and then loop them through a block of my XML Code.
Example:
[PHP]<?PHP
//Open Includes for page information.
include_once(". ./../gatewayapi/inc_gatewayapi. php");
include_once(". ./../Connections/jpbdadd.php");
include_once(". ./../db_calls/get_session.php ");
// NEED HELP HERE!!
$query = ($xmlTtVarSet);
$res = mysql_query($qu ery);
if(!$res){
die(mysql_error ());
}
$num = mysql_num_rows( $res);
$i=0;
while ($i < $num) {
//code to run
$xmlString .= "<Kiosks>\n ";
$xmlString .= "<Kiosks>\n ";
$xmlString .= "<KiBus>\n" ;
$xmlString .= "<tt_legal_name >" . $ttLegalName . "</tt_legal_name>\ n";
$xmlString .= "<tt_dba_na me>" . $ttDbaName . "</tt_dba_name>\n" ;
$xmlString .= "<device_ty pe>" . "KOS" . "</device_type>\n" ;
if (ttDynmcDesc != "") {
$xmlString .= "<dynamic_descr iption>" . $ttDynmcDesc . "</dynamic_descrip tion>\n”; }
if $ttPosCd != "") {
$xmlString .= "<pos_code> " . $ttPosCd . “</pos_code>\n";
}
if ($ttStandIn != "") {
$xmlString .= "<standin>" . $ttStandIn . “</standin>\n";
}
if ($ttTmZone != "0") {
$xmlString .= "<time_zone >" . $ttTmZone . “</time_zone>\n";//
}
if ($ttDupChk != "") {
$xmlString .= "<duplicate_che cking>" . $ttDupChk . “</duplicate_check ing>\n";//
}
if ($ttChrgDesc != "") {
$xmlString .= "<charge_descri ption>" . $ttChrgDesc . “</charge_descript ion>\n";
}
if ($ttHubFlg != "") {
$xmlString .= "<hub_flag> " . $ttHubFlg . “</hub_flag>\n";// currently used only for DFW WinHub
}
if ($ttAltCityDisc != "") {
$xmlString .= "<tt_alt_city_d escriptor>" . $ttAltCityDisc . “</tt_alt_city_des criptor>\n";
}
$xmlString .= "</KeiBus>\n";
$xmlString .= "<KiEquipments> \n";
$xmlString .= "<KiEquipment>\ n";
if ($ttSerialNo != "") {
$xmlString .= "<device_serial _no>" . $ttSerialNo . “</device_serial_n o>\n";
}
if ($ttDevEsn != "") {
$xmlString .= "<device_es n>" . $ttDevEsn . “</device_esn>\n";
}
if ($ttDevMann != "") {
$xmlString .= "<device_ma nn>" . $ttDevMann'] ."</device_mann>\n" ;
}
if ($ttDevSim != "") {
$xmlString .= "<device_si m>" . $ttDevSim . “</device_sim>\n";
}
if ($ttAddInfo != "") {
$xmlString .= "<device_additi onal_info>" . $ttAddInfo . “</device_addition al_info>\n";
}
if ($ttDevPbx != "") {
$xmlString .= "<device_pb x>" . $ttDevPbx'] ."</device_pbx>\n";
}
$xmlString .= "<device_catego ry>" . "KIOSK" . "</device_category >\n";
if ($ttDevName != "") {
$xmlString .= "<device_na me>" . $ttDevName . “</device_name>\n" ;
}
if ($ttDevMod != "") {
$xmlString .= "<device_model> " . $ttDevMod . “</device_model>\n ";
}
if ($ttDevAppType != "") {
$xmlString .= "<device_applic ation>" . $ttDevAppType . “</device_applicat ion>\n";
}
if ($ttGateWay != "") {
$xmlString .= "<device_gatewa y>" . $ttGateWay . “</device_gateway> \n";
}
if ($ttDevCommFmt != "") {
$xmlString .= "<device_comm_f ormat>" . $ttDevCommFmt . “</device_comm_for mat>\n";
}
if ($ttDialUp != "") {
$xmlString .= "<device_dial_u p>" . $ttDialUp . “</device_dial_up> \n";
}
$xmlString .= "<device_fl ag>" . "N" . "</device_flag>\n" ;
$xmlString .= "</KiEquipment>\n" ;
$xmlString .= "</KiEquipments>\n ";
$xmlString .= "</Kiosk>\n";
$xmlString .= "</Kiosks>\n";
$i++;
}
//Print results to page.
echo "<pre>";
print_r($xmlStr ing);
echo "</pre>";
?>[/PHP]
So that’s it, any direction, examples, thoughts, re-work, would be most helpful
Thanks
Nine72
Comment