Sliding menu of images

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phobia1
    New Member
    • Oct 2009
    • 18

    Sliding menu of images

    Hi to all
    I can make a presentation of fixed images easily in Flash.
    I want to ask if its possible to do it dynamically from a database?
    Regards
    F
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    You can either have action script access the database or have PHP get it from the database and give it to your flash application.



    Dan

    Comment

    • phobia1
      New Member
      • Oct 2009
      • 18

      #3
      Thanks

      I'll get digging into reading.
      Best
      F

      Comment

      • phobia1
        New Member
        • Oct 2009
        • 18

        #4
        xml from database

        Hi Guys
        I have this piece of code that is supposed to produce XML from data retrieved from database Garant. Could anyon tell me why it has stopped working? Its bound to be syntax again but I would appreciate a second pair of eyes to look at it.
        Regards FJW

        Code:
        <?PHP
        // slider.php
        require("./resources/globals.php") ;
        // Generate the SQL command for doing a select from the Database
        $query = "SELECT smallpic,Ref,Pic1 FROM Garant LIMIT 10";
        
        // Connect to the Database
        $link=mysql_connect($location,$userName,$passwor d) or die (mysql_error());
        mysql_select_db($dbname) or die (mysql_error());
        $results=mysql_query($query) or die (mysql_error());
        
        // Select the Database
        if (!mysql_select_db($dbname, $link)) {
         DisplayErrMsg(sprintf("Error in selecting %s database", $dbname)) ;
         DisplayErrMsg(sprintf("error:%d %s", mysql_errno($link), mysql_error($link))) ;
         exit() ;
        }
        // Execute the Statement
        if (!($results =mysql_query($query, $link))) {
         DisplayErrMsg(sprintf("Error in executing %s stmt", $query)) ;
         DisplayErrMsg(sprintf("error:%d %s", mysql_errno($link), mysql_error($link))) ;
         exit() ;
        }
        // Display the results of the query
        //header("Content-type: text/xml");
        $linkID = mysql_connect($localhost, $userName, $password) or die("Could not connect to host.");
        mysql_select_db($dbname, $linkID) or die("Could not find database.");
        
        $resultID = mysql_query($query, $linkID) or die("Data not found.");
        $xml_output = "<?xml version=\"1.0\"?>\n";
        $xml_output .= "<images>\n";
        for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){
         $row = mysql_fetch_assoc($resultID);
         $xml_output .= "<image src=\"images/tn/";
         $xml_output .= "".$row['smallpic']."";
         $xml_output .= "\" title=\"\" url=\"images/";
         $xml_output .= "".$row['Pic1']."";
         $xml_output .=" \">\n";
        }
         $xml_output .= "</images>";
        echo $xml_output;
        ?>
        Last edited by Dormilich; Nov 23 '09, 02:16 PM. Reason: Please use [code] tags when posting code

        Comment

        • phobia1
          New Member
          • Oct 2009
          • 18

          #5
          This change now enables display but...

          Code:
          echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
           $xml_output .= "<images>\n";
           for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){
           $row = mysql_fetch_assoc($resultID);
           $xml_output .= "<image src=\"images/tn/";
           $xml_output .= "".$row['smallpic']."";
           $xml_output .= "\" title=\"\" url=\"images/";
           $xml_output .= "".$row['Pic1']."";
           $xml_output .=" \" />\n";
          }
          $xml_output .= "</images>";
          echo $xml_output;
           ?>
          Last edited by Dormilich; Nov 23 '09, 02:17 PM. Reason: Please use [code] tags when posting code

          Comment

          • phobia1
            New Member
            • Oct 2009
            • 18

            #6
            thread closed as I got it all working fully automatically

            Comment

            Working...