Ok I've been working on this for two weeks. I am using PHP/MySql to store info for a XML formatted doc. I used the technique from www.gotoandlearn.com to produce XML with PHP. I added the ability to write the XML file that show up in IE and that works great. I recently made a change to have keywords in a separate DB because I need to have the keywords inputted separately in the XML. This XML file is used for SCORM compliancy based on the ADL website https://adlregistry.dtic.mil/ (https://adlregistry.dtic.mil/6/index2_7.htm).

The problem now is that when I run the script to produce the XML page via IE and write it into the xml folder it prints the keyword in IE but it will not write them in the .xml file. It writes all the other data but just shows the do while loop i have. Below is the code. To me it appears that the variable is not being reconized in the bottome write file portion of the code. This was done with Dreamweaver and Handcoding and reworked code off the internet. The page is intitated by clicking on a link that displays the course title and takes you to a page that displays all the course info in XML format.

Thanks
BygMony

<?php require_once('../Connections/scorm.php'); ?>
<?php
$colname_rsScorm = "-1";
if (isset($_GET['SCO_Description'])) {
  $colname_rsScorm = (get_magic_quotes_gpc()) ? $_GET['SCO_Description'] : addslashes($_GET['SCO_Description']);
}
$colname2_rsScorm2 = "-1";
if (isset($_GET['SCO_Description'])) {
  $colname2_rsScorm2 = (get_magic_quotes_gpc()) ? $_GET['SCO_Description'] : addslashes($_GET['SCO_Description']);
}
mysql_select_db($database_scorm, $scorm);
$query_rsScorm = sprintf("SELECT * FROM sco_metadata WHERE COI_Number = %s", $colname_rsScorm);
$rsScorm = mysql_query($query_rsScorm, $scorm) or die(mysql_error());
$row_rsScorm = mysql_fetch_assoc($rsScorm);
$totalRows_rsScorm = mysql_num_rows($rsScorm);

mysql_select_db($database_scorm, $scorm);
$query_rsScorm2 = sprintf("SELECT * FROM keywords WHERE COI_Number = %s", $colname2_rsScorm2);
$rsScorm2 = mysql_query($query_rsScorm2, $scorm) or die(mysql_error());
$row_rsScorm2 = mysql_fetch_assoc($rsScorm2);
$totalRows_rsScorm2 = mysql_num_rows($rsScorm2);

$results2 = mysql_query($query_rsScorm2);
$line2 = mysql_fetch_assoc($results2);


$results = mysql_query($query_rsScorm);
$line = mysql_fetch_assoc($results);

?>

<?php /* $line["database field"] must make upper/lower case */


echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";

echo "<registryTransaction xmls=\"http://hdl.cordra.net/2000.2.1/ADL-R-Reg-T\" xmlns:lom=\"http://Itsc.ieee.org/xsd/LOM\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://Itsc.ieee.org/xsd/LOMhttp://hdl.cordra.net/2000.2/adlreg-lom?VData=version&amp;id=1http://hdl.cordra.net/2000.2.1/ADL-R-Reg-Thttp://hdl.cordra.net/2000.2.1/ADL-R-Reg-T?VData=version&amp;=1\">\n";

echo "<course_metadata>\n";


echo "<metadata>\n";



   echo "<mod_title>" . $line["Module_Title"] . "</mod_title>\n";
   echo  "<lesson_title>" . $line["Lesson_Title"] . "</lesson_title>\n";
   echo   "<coi_num>" . $line["COI_Number"]. "</coi_num>\n";
   echo    "<version>" . $line["Version"] . "</version>\n";

   //work great, loops and displays all keywords from keyword database
   do {
   echo   "<lom:keyword>\n";
   echo   "<lom:string language=\"en-US\">" . $line2["Keywords"] . "</lom:string>\n";
   echo    "</lom:keyword>\n";
   }
   while($line2 = mysql_fetch_assoc($results2));
   echo      "<status>" . $line["Status"] ."</status>\n";
   echo       "<sco_description>" . $line["SCO_Description"] . "</sco_description>\n";
   echo        "<date_created>" . $line["Date_Created"] . "</date_created>\n";
   echo         "<security_classification>" . $line["Security_Classification"] . "</security_classification>\n";
   echo          "<format>" . $line["Format"] . "</format>\n";
   echo         "<document>" . $line["Document_Handler"] . "</document>\n";
   echo        "<interactivity_level>" . $line["Interactivity_Level"] . "</interactivity_level>\n";
   echo       "<learning_resource_type>" . $line["Learning_Resource_Type"] . "</learning_resource_type>\n";
   echo      "<contribute>" . $line["Contribute"] . "</contribute>\n";
   echo     "<copyright>" . $line["Copyright_restrictions"] . "</copyright>\n";
   echo    "<location>" . $line["Location"] . "</location>\n";
   echo   "<aggregation_level>" . $line["Aggregation_Level"] . "</aggregation_level>\n";
   echo  "<knowledge_type>" . $line["Knowledge_Type"] . "</knowledge_type>\n";
   echo "<terminal_learning_obj>" . $line["Terminal_Learning_Obj"] . "</terminal_learning_obj>\n";


echo "</metadata>\n";



echo "</course_metadata>\n";
echo "</registryTransaction>\n";

//Write .xml file to folder

$myFile = str_replace(' ','',$line["Module_Title"]). '.xml';
$fh = fopen("xml/".$myFile, 'w') or die("can't open file");
$stringData = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>
<registryTransaction xmls=\"http://hdl.cordra.net/2000.2.1/ADL-R-Reg-T\" xmlns:lom=\"http://Itsc.ieee.org/xsd/LOM\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://Itsc.ieee.org/xsd/LOMhttp://hdl.cordra.net/2000.2/adlreg-lom?VData=version&amp;id=1http://hdl.cordra.net/2000.2.1/ADL-R-Reg-Thttp://hdl.cordra.net/2000.2.1/ADL-R-Reg-T?VData=version&amp;=1\">

<course_metadata>
<metadata>
<mod_title>" . $line["Module_Title"] . "</mod_title>
<lesson_title>" . $line["Lesson_Title"] . "</lesson_title>
<coi_num>" . $line["COI_Number"] . "</coi_num>
<version>" . $line["Version"] . "</version>
<!--This will not loop and it prints the loop as you see it.-->
do
{
<lom:keyword>
<lom:string language=\"en-US\">" . $line2["Keywords"] . "</lom:string>
</lom:keyword>
 }
   while($line2 = mysql_fetch_assoc($results2));<!--It calls $results2 resource id #6 and deletes $line2. Everything else prints out to a text file correctly-->
<status>" . $line["Status"] ."</status>
<sco_description>" . $line["SCO_Description"] . "</sco_description>
<date_created>" . $line["Date_Created"] . "</date_created>
<security_classification>" . $line["Security_Classification"] . "</security_classification>
<format>" . $line["Format"] . "</format>
<document>" . $line["Document_Handler"] . "</document>
<interactivity_level>" . $line["Interactivity_Level"] . "</interactivity_level>
<learning_resource_type>" . $line["Learning_Resource_Type"] . "</learning_resource_type>
<contribute>" . $line["Contribute"] . "</contribute>
<copyright>" . $line["Copyright_restrictions"] . "</copyright>
<location>" . $line["Location"] . "</location>
<aggregation_level>" . $line["Aggregation_Level"] . "</aggregation_level>
<knowledge_type>" . $line["Knowledge_Type"] . "</knowledge_type>
<terminal_learning_obj>" . $line["Terminal_Learning_Obj"] . "</terminal_learning_obj>
</metadata>
</course_metadata>
</registryTransaction>\n";
fwrite($fh, $stringData);
fclose($fh);


mysql_free_result($rsScorm);

mysql_free_result($rsScorm2);
?>

---------------------------------XML FILE THAT GETS WRITTEN--------------------------------------

<?xml version="1.0" encoding="utf-8" ?>
<registryTransaction xmls="http://hdl.cordra.net/2000.2.1/ADL-R-Reg-T" xmlns:lom="http://Itsc.ieee.org/xsd/LOM" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://Itsc.ieee.org/xsd/LOMhttp://hdl.cordra.net/2000.2/adlreg-lom?VData=version&amp;id=1http://hdl.cordra.net/2000.2.1/ADL-R-Reg-Thttp://hdl.cordra.net/2000.2.1/ADL-R-Reg-T?VData=version&amp;=1">

<course_metadata>
<metadata>
<mod_title>Griffin</mod_title>
<lesson_title>BygMony</lesson_title>
<coi_num>990923</coi_num>
<version>1</version>
<!--This will not loop and it prints the loop as you see it.-->
do
{
<lom:keyword>
<lom:string language="en-US"></lom:string>
</lom:keyword>
 }
   while( = mysql_fetch_assoc(Resource id #6));<!--It calls Resource id #6 resource id #6 and deletes . Everything else prints out to a text file correctly-->
<status>Green</status>
<sco_description>None.</sco_description>
<date_created>Nov 29, 2005</date_created>
<security_classification>Classified</security_classification>
<format>full</format>
<document>FOUO</document>
<interactivity_level>Category 1</interactivity_level>
<learning_resource_type>Web based</learning_resource_type>
<contribute>none</contribute>
<copyright>none</copyright>
<location>www.jfcom.mil</location>
<aggregation_level>6</aggregation_level>
<knowledge_type>Process</knowledge_type>
<terminal_learning_obj>none.</terminal_learning_obj>
</metadata>
</course_metadata>
</registryTransaction>

    please wrap your PHP code examples using the bbcode php tags... it makes it easier to read for us

    thank you

      Thanks I forgot I could do that.

      BygMony

        just a few things i see

        1) you define two instances of a $totalrows variable but u never use it... so why bother defining it?

        2) you call the select db function twice... if the DB doesnt change, theres no need to select it again

        3) you dont need to open and close your PHP tags twice in the beginning of the script

        <?php require_once('../Connections/scorm.php'); 
        //rest of code
        ?>
        

        is perfectly fine

        4) Forgive if im wrong but isnt this the same exact code twice?

        //$colname_rsScorm = "-1";
        if (isset($_GET['SCO_Description'])) {
          $colname_rsScorm = (get_magic_quotes_gpc()) ? $_GET['SCO_Description'] : addslashes($_GET['SCO_Description']);
        }
        //$colname2_rsScorm2 = "-1";
        if (isset($_GET['SCO_Description'])) {
          $colname2_rsScorm2 = (get_magic_quotes_gpc()) ? $_GET['SCO_Description'] : addslashes($_GET['SCO_Description']);
        } 
        

        is there a reason for this?

          I have two DB connections, the second is going to the keywords DB. Also this is something Dreamweaver does. You'll see one is $colname_rsScorm and the other is $colname2_rsScorm2

            Below is the out put from the 2 DB's. The keyword section is from the keywords DB.

              <?xml version="1.0" encoding="utf-8" ?> 
            - <registryTransaction xmls="http://hdl.cordra.net/2000.2.1/ADL-R-Reg-T" xmlns:lom="http://Itsc.ieee.org/xsd/LOM" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://Itsc.ieee.org/xsd/LOMhttp://hdl.cordra.net/2000.2/adlreg-lom?VData=version&id=1http://hdl.cordra.net/2000.2.1/ADL-R-Reg-Thttp://hdl.cordra.net/2000.2.1/ADL-R-Reg-T?VData=version&=1">
            - <course_metadata>
            - <metadata>
              <mod_title>Griffin</mod_title> 
              <lesson_title>BygMony</lesson_title> 
              <coi_num>990923</coi_num> 
              <version>1</version> 
            - <lom:keyword>
              <lom:string language="en-US">yankee</lom:string> 
              </lom:keyword>
            - <lom:keyword>
              <lom:string language="en-US">Avaya</lom:string> 
              </lom:keyword>
            - <lom:keyword>
              <lom:string language="en-US">Snowball</lom:string> 
              </lom:keyword>
            - <lom:keyword>
              <lom:string language="en-US">Windmill</lom:string> 
              </lom:keyword>
            - <lom:keyword>
              <lom:string language="en-US">Cowboy</lom:string> 
              </lom:keyword>
              <status>Green</status> 
              <sco_description>None.</sco_description> 
              <date_created>Nov 29, 2005</date_created> 
              <security_classification>Classified</security_classification> 
              <format>full</format> 
              <document>FOUO</document> 
              <interactivity_level>Category 1</interactivity_level> 
              <learning_resource_type>Web based</learning_resource_type> 
              <contribute>none</contribute> 
              <copyright>none</copyright> 
              <location>www.jfcom.mil</location> 
              <aggregation_level>6</aggregation_level> 
              <knowledge_type>Process</knowledge_type> 
              <terminal_learning_obj>none.</terminal_learning_obj> 
              </metadata>
              </course_metadata>
              </registryTransaction>
            

              well yea but just b/c DW does it, doesnt make it right... if its the same code running twice its not efficient

                Rgr that. the main part that I can not figure out is in the //write an xml file section with or with out the do while loop it still will not write any keywords from the keywords DB. Also I would need it to loop and write all the keywords just as it did in the IE output. I did notice that when I take the do while loop away from the call to produce the XML file I can get it to write a keyword from the keyword DB.

                     while($line2 = mysql_fetch_assoc($results2)); 

                  This line doesn't do anything. The problem is that it starts a loop and then (thanks to the ';') it immediately ends it again. So PHP hits the line, runs through all the records of $results2, and literally does nothing with them.

                  If that's the sort of code that Dreamweaver produces then it should be taken out and shot; I having a hard time even figuring out what that code is supposed to be doing. But have a look at the XML:

                  <?xml version="1.0" encoding="utf-8" ?>
                  <registryTransaction xmls="http://hdl.cordra.net/2000.2.1/ADL-R-Reg-T" xmlns:lom="http://Itsc.ieee.org/xsd/LOM" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://Itsc.ieee.org/xsd/LOMhttp://hdl.cordra.net/2000.2/adlreg-lom?VData=version&amp;id=1http://hdl.cordra.net/2000.2.1/ADL-R-Reg-Thttp://hdl.cordra.net/2000.2.1/ADL-R-Reg-T?VData=version&amp;=1">
                  
                  <course_metadata>
                  <metadata>
                  <mod_title>Griffin</mod_title>
                  <lesson_title>BygMony</lesson_title>
                  <coi_num>990923</coi_num>
                  <version>1</version>
                  <!--This will not loop and it prints the loop as you see it.-->
                  do
                  {
                  <lom:keyword>
                  <lom:string language="en-US"></lom:string>
                  </lom:keyword>
                  }
                     while( = mysql_fetch_assoc(Resource id #6));<!--It calls Resource id #6 resource id #6 and deletes . Everything else prints out to a text file correctly-->
                  <status>Green</status>
                  <sco_description>None.</sco_description>
                  <date_created>Nov 29, 2005</date_created>
                  <security_classification>Classified</security_classification>
                  <format>full</format>
                  <document>FOUO</document>
                  <interactivity_level>Category 1</interactivity_level>
                  <learning_resource_type>Web based</learning_resource_type>
                  <contribute>none</contribute>
                  <copyright>none</copyright>
                  <location>www.jfcom.mil</location>
                  <aggregation_level>6</aggregation_level>
                  <knowledge_type>Process</knowledge_type>
                  <terminal_learning_obj>none.</terminal_learning_obj>
                  </metadata>
                  </course_metadata>
                  </registryTransaction>

                  There's a chunk of code in there that PHP seems to think is supposed to be part of a string. If you look at the syntax-highlighted code you've posted, you'll see that the highlighting goes out of whack at about that point - you've left out a quote.

                  I also note you try and do all that XML generation twice. Not only is that hideously inefficient, but if you don't reset the database results after you've looped through them the first time, there won't be any records left in them when you try looping for the second time.

                  <?php require_once('../Connections/scorm.php');
                  
                  $colname_rsScorm = "-1";
                  if (isset($_GET['SCO_Description'])) {
                    $colname_rsScorm = (get_magic_quotes_gpc()) ? $_GET['SCO_Description'] : addslashes($_GET['SCO_Description']);
                  }
                  
                  mysql_select_db($database_scorm, $scorm);
                  // Since this data is coming from the outside world, we can't trust it to be
                  // legitimate. I'll assume it's _supposed_ to be an integer, but I won't assume
                  // it _is_.
                  
                  // Having mysql_error() is fine for development, but should be taken out of
                  // production code.
                  
                  $query_rsScorm = sprintf("SELECT * FROM sco_metadata WHERE COI_Number = %s", intval($colname_rsScorm));
                  $rsScorm = mysql_query($query_rsScorm, $scorm) or die(mysql_error());
                  $metadata = mysql_fetch_assoc($rsScorm);
                  
                  $query_rsScorm2 = sprintf("SELECT * FROM keywords WHERE COI_Number = %s", intval($colname2_rsScorm));
                  $rsScorm2 = mysql_query($query_rsScorm2, $scorm) or die(mysql_error());
                  $keywords = mysql_fetch_assoc($rsScorm2);
                  
                  // We want to save this to a folder _and_ output it to the client.
                  // One way to do that is to buffer the output and then save the buffer.
                  // Another choice is to build up a big string variable and save/output the
                  // contents of that
                  // Worst choice is to do all the computations twice.
                  //
                  // Since I already went for the first choice before realising that it was all
                  // being done twice...
                  
                  ob_start();
                  
                  echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
                  ?>
                  <registryTransaction
                  	xmls="http://hdl.cordra.net/2000.2.1/ADL-R-Reg-T"
                  	xmlns:lom="http://Itsc.ieee.org/xsd/LOM"
                  	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  	xsi:schemaLocation="http://Itsc.ieee.org/xsd/LOMhttp://hdl.cordra.net/2000.2/adlreg-lom?VData=version&amp;id=1http://hdl.cordra.net/2000.2.1/ADL-R-Reg-Thttp://hdl.cordra.net/2000.2.1/ADL-R-Reg-T?VData=version&amp;=1">
                  <course_metadata>
                  <metadata>
                  <mod_title><?php echo $metadata['Module_Title']?></mod_title>
                  <lesson_title><?php echo $metadata['Module_Title']?></lesson_title>
                  <coi_num><?php echo $metadata['Module_Title']?></coi_num>
                  <version><?php echo $metadata['Module_Title']?></version>
                  <?php
                  while($keyword=mysql_fetch_assoc($rsCorm2))
                  {
                  ?>
                  	<lom:keyword>
                  		<lom:string language="en-US"><?php echo $keywords['Keywords']?></lom:string>
                  	</lom:keyword>
                  <?php
                  }
                  ?>
                  <status></php echo $metadata['Status']</status>
                  etc.etc.etc.
                  </metadata>
                  </course_metadata>
                  </registryTransaction>
                  <?
                  // Capture XML for saving
                  $stringData = ob_get_contents();
                  // Flush XML to output
                  ob_end_flush();
                  
                  $myFile = str_replace(' ','',$metadata["Module_Title"]). '.xml';
                  $fh = fopen("xml/".$myFile, 'w') or die("can't open file");
                  fwrite($fh, $stringData);
                  fclose($fh);
                  ?>
                  

                    This works much smoother. but the while loop will not display the <keyword> tags in the output or file. It outputs all other tags and writes them to a file. If you use a do while loop the <keyword> tag display as an empty tag in the output and file. it seems as if this part below is not reading the DB.

                    mysql_select_db($database_scorm, $scorm);
                    $query_rsScorm2 = sprintf("SELECT * FROM keywords WHERE COI_Number = %s", intval($colname_rsScorm2));
                    $rsScorm2 = mysql_query($query_rsScorm2, $scorm);
                    $keywords = mysql_fetch_assoc($rsScorm2);
                    
                    <?php require_once('../Connections/scorm.php'); ?>
                    <?php
                    $colname_rsScorm = "-1";
                    if (isset($_GET['SCO_Description'])) {
                      $colname_rsScorm = (get_magic_quotes_gpc()) ? $_GET['SCO_Description'] : addslashes($_GET['SCO_Description']);
                    }
                    mysql_select_db($database_scorm, $scorm);
                    $query_rsScorm = sprintf("SELECT * FROM sco_metadata WHERE COI_Number = %s", intval($colname_rsScorm));
                    $rsScorm = mysql_query($query_rsScorm, $scorm);
                    $metadata = mysql_fetch_assoc($rsScorm);
                    
                    mysql_select_db($database_scorm, $scorm);
                    $query_rsScorm2 = sprintf("SELECT * FROM keywords WHERE COI_Number = %s", intval($colname_rsScorm2));
                    $rsScorm2 = mysql_query($query_rsScorm2, $scorm);
                    $keywords = mysql_fetch_assoc($rsScorm2);
                    
                    ob_start();
                    echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
                    
                    ?>
                    
                    <registryTransaction xmls="http://hdl.cordra.net/2000.2.1/ADL-R-Reg-T" 
                    xmlns:lom="http://Itsc.ieee.org/xsd/LOM" 
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                    xsi:schemaLocation="http://Itsc.ieee.org/xsd/LOMhttp://hdl.cordra.net/2000.2/adlreg-lom?VData=version&amp;id=1
                    http://hdl.cordra.net/2000.2.1/ADL-R-Reg-Thttp://hdl.cordra.net/2000.2.1/ADL-R-Reg-T?VData=version&amp;=1">
                    
                    <course_metadata>
                    
                    
                    <metadata>	
                    
                    <mod_title><?php echo $metadata['Module_Title']?></mod_title>
                    <lesson_title><?php echo $metadata['Lesson_Title']?></lesson_title>
                    <coi_num><?php echo $metadata['COI_Number']?></coi_num>
                    <version><?php echo $metadata['Version']?></version>
                    <?php 
                    
                    do
                    {
                    ?>
                    <lom:keyword>
                    <lom:string language="en-US"><?php $keywords['Keywords']?></lom:string>
                    </lom:keyword>
                    
                    <?php
                    } while($keywords=mysql_fetch_assoc($rsScorm2))
                    ?>
                    
                    <status><?php echo $metadata['Status']?></status>
                    <sco_description><?php echo $metadata['SCO_Description']?></sco_description>
                    <date_created><?php echo $metadata['Date_Created']?></date_created>
                    <security_classification><?php echo $metadata['Security_Classification']?></security_classification>
                    <format><?php echo $metadata['Format']?></format>
                    <document><?php echo $metadata['Document_Handler']?></document>
                    <interactivity_level><?php echo $metadata['Interactivity_Level']?></interactivity_level>
                    <learning_resource_type><?php echo $metadata['Learning_Resource_Type']?></learning_resource_type>
                    <contribute><?php echo $metadata['Contribute']?></contribute>
                    <copyright><?php echo $metadata['Copyright_restrictions']?></copyright>
                    <location><?php echo $metadata['Location']?></location>
                    <aggregation_level><?php echo $metadata['Aggregation_Level']?></aggregation_level>
                    <knowledge_type><?php echo $metadata['Knowledge_Type']?></knowledge_type>
                    <terminal_learning_obj><?php echo $metadata['Terminal_Learning_Obj']?></terminal_learning_obj>
                    
                    
                    </metadata>
                    </course_metadata>
                    </registryTransaction>
                    <?PHP
                    //Capture XML For Saving
                    $stringData = ob_get_contents();
                    //Flush XML to output
                    ob_end_flush();
                    //Write .xml file to folder
                    $myFile = str_replace(' ','',$metadata["Module_Title"]). '.xml';
                    $fh = fopen("xml/".$myFile, 'w') or die("can't open file");
                    fwrite($fh, $stringData);
                    fclose($fh);
                    
                    
                    mysql_free_result($rsScorm);
                    mysql_free_result($rsScorm2);
                    ?>
                    

                    The XML output

                      <?xml version="1.0" encoding="utf-8" ?> 
                    - <registryTransaction xmls="http://hdl.cordra.net/2000.2.1/ADL-R-Reg-T" xmlns:lom="http://Itsc.ieee.org/xsd/LOM" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://Itsc.ieee.org/xsd/LOMhttp://hdl.cordra.net/2000.2/adlreg-lom?VData=version&id=1 http://hdl.cordra.net/2000.2.1/ADL-R-Reg-Thttp://hdl.cordra.net/2000.2.1/ADL-R-Reg-T?VData=version&=1">
                    - <course_metadata>
                    - <metadata>
                      <mod_title>Griffin</mod_title> 
                      <lesson_title>BygMony</lesson_title> 
                      <coi_num>990923</coi_num> 
                      <version>1</version> 
                    - <lom:keyword>
                      <lom:string language="en-US" /> 
                      </lom:keyword>
                      <status>Green</status> 
                      <sco_description>None.</sco_description> 
                      <date_created>Nov 29, 2005</date_created> 
                      <security_classification>Classified</security_classification> 
                      <format>full</format> 
                      <document>FOUO</document> 
                      <interactivity_level>Category 1</interactivity_level> 
                      <learning_resource_type>Web based</learning_resource_type> 
                      <contribute>none</contribute> 
                      <copyright>none</copyright> 
                      <location>www.jfcom.mil</location> 
                      <aggregation_level>6</aggregation_level> 
                      <knowledge_type>Process</knowledge_type> 
                      <terminal_learning_obj>none.</terminal_learning_obj> 
                      </metadata>
                      </course_metadata>
                      </registryTransaction>
                    

                    Heading to lunch be right back. Thanks for the help.

                      Ok fellas Thanks for everything. with your help (99%) I was able to figure it out (1%) :0). I know most of you don't like the Dreamweaver thing but I am on a time crunch and hand coding every inch doesn't help me to meet their deadlines.

                      Weedpacket redo of the code was great. The only thing I was doing wrong was I forgot to add "ECHO" in the

                      do
                      	{
                      	?>
                      	<lom:keyword>
                      	<lom:string language="en-US"><?php echo $keywords['Keywords']?></lom:string>
                      	</lom:keyword>
                      
                      <?php
                      } while($keywords=mysql_fetch_assoc($rsScorm2))
                      ?>
                      

                      I also had to make it a do while loop because the while loop did not show all the associated records.

                      The big thing I had to add "probalby a Dreamweaver thing" is this code

                      $colname_rsScorm2 = "-1";
                      if (isset($_GET['SCO_Description'])) {
                        $colname_rsScorm2 = (get_magic_quotes_gpc()) ? $_GET['SCO_Description'] : addslashes($_GET['SCO_Description']);
                      }
                      

                      I know ya'll said I am calling this twice but DW will not access the DB without it.

                      Besides I am running this locally and not to the public. The purpose of this is to store the metadata for the ADL Registry of the SCORM 2004 course vise hand typing this for each course. Yes I know there are programs out there that already do this but the Big Bosses are not releasing any funds so I figured I'll make my own.

                      Again thanks this will help us save about 100 hours a month in man hours and put that time into doing some real development.

                      Here is the .xml out put i wanted

                      <?xml version="1.0" encoding="utf-8" ?>
                      
                      <registryTransaction xmls="http://hdl.cordra.net/2000.2.1/ADL-R-Reg-T" 
                      xmlns:lom="http://Itsc.ieee.org/xsd/LOM" 
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                      xsi:schemaLocation="http://Itsc.ieee.org/xsd/LOMhttp://hdl.cordra.net/2000.2/adlreg-lom?VData=version&amp;id=1
                      http://hdl.cordra.net/2000.2.1/ADL-R-Reg-Thttp://hdl.cordra.net/2000.2.1/ADL-R-Reg-T?VData=version&amp;=1">
                      
                      <course_metadata>
                      
                      
                      <metadata>	
                      
                      <mod_title>Griffin</mod_title>
                      <lesson_title>BygMony</lesson_title>
                      <coi_num>990923</coi_num>
                      <version>1</version>
                      
                      <!-- Look at it isn't it beautful-->
                      		<lom:keyword>
                      	<lom:string language="en-US">yankee</lom:string>
                      	</lom:keyword>
                      
                      	<lom:keyword>
                      <lom:string language="en-US">Avaya</lom:string>
                      </lom:keyword>
                      
                      	<lom:keyword>
                      <lom:string language="en-US">Snowball</lom:string>
                      </lom:keyword>
                      
                      	<lom:keyword>
                      <lom:string language="en-US">Windmill</lom:string>
                      </lom:keyword>
                      
                      	<lom:keyword>
                      <lom:string language="en-US">Cowboy</lom:string>
                      </lom:keyword>
                      
                      
                      <status>Green</status>
                      <sco_description>None.</sco_description>
                      <date_created>Nov 29, 2005</date_created>
                      <security_classification>Classified</security_classification>
                      <format>full</format>
                      <document>FOUO</document>
                      <interactivity_level>Category 1</interactivity_level>
                      <learning_resource_type>Web based</learning_resource_type>
                      <contribute>none</contribute>
                      <copyright>none</copyright>
                      <location>www.jfcom.mil</location>
                      <aggregation_level>6</aggregation_level>
                      <knowledge_type>Process</knowledge_type>
                      <terminal_learning_obj>none.</terminal_learning_obj>
                      
                      
                      </metadata>
                      </course_metadata>
                      </registryTransaction>
                      

                      BygMony

                        Incidentally

                        BigMony wrote:

                        I have two DB connections, the second is going to the keywords DB.

                        No you don't. You have two database connections both going to the same database, and you're querying two different tables ("keywords" and "sco_metadata") in that db.

                          You are right I was thinking backwards. However, with DW it needed that other piece of code in order for it to work. I know in the real hand coding world it is different. Please cut me some slack on this, again it is only being used internally so we can cut out hand code 50 plus XML line documents for the 150 pluse course being developed. Again I do thank you and my boss also says thanks.

                          BygMony

                            Write a Reply...