Connecting Tech Pros Worldwide Forums | Help | Site Map

Sliding menu of images

Newbie
 
Join Date: Oct 2009
Posts: 15
#1: 1 Week Ago
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's Avatar
Expert
 
Join Date: Dec 2007
Location: Moon, Dark Side
Posts: 1,095
#2: 1 Week Ago

re: Sliding menu of images


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
Newbie
 
Join Date: Oct 2009
Posts: 15
#3: 1 Week Ago

re: Sliding menu of images


I'll get digging into reading.
Best
F
Newbie
 
Join Date: Oct 2009
Posts: 15
#4: 6 Days Ago

re: Sliding menu of images


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

Expand|Select|Wrap|Line Numbers
  1. <?PHP
  2. // slider.php
  3. require("./resources/globals.php") ;
  4. // Generate the SQL command for doing a select from the Database
  5. $query = "SELECT smallpic,Ref,Pic1 FROM Garant LIMIT 10";
  6.  
  7. // Connect to the Database
  8. $link=mysql_connect($location,$userName,$passwor d) or die (mysql_error());
  9. mysql_select_db($dbname) or die (mysql_error());
  10. $results=mysql_query($query) or die (mysql_error());
  11.  
  12. // Select the Database
  13. if (!mysql_select_db($dbname, $link)) {
  14.  DisplayErrMsg(sprintf("Error in selecting %s database", $dbname)) ;
  15.  DisplayErrMsg(sprintf("error:%d %s", mysql_errno($link), mysql_error($link))) ;
  16.  exit() ;
  17. }
  18. // Execute the Statement
  19. if (!($results =mysql_query($query, $link))) {
  20.  DisplayErrMsg(sprintf("Error in executing %s stmt", $query)) ;
  21.  DisplayErrMsg(sprintf("error:%d %s", mysql_errno($link), mysql_error($link))) ;
  22.  exit() ;
  23. }
  24. // Display the results of the query
  25. //header("Content-type: text/xml");
  26. $linkID = mysql_connect($localhost, $userName, $password) or die("Could not connect to host.");
  27. mysql_select_db($dbname, $linkID) or die("Could not find database.");
  28.  
  29. $resultID = mysql_query($query, $linkID) or die("Data not found.");
  30. $xml_output = "<?xml version=\"1.0\"?>\n";
  31. $xml_output .= "<images>\n";
  32. for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){
  33.  $row = mysql_fetch_assoc($resultID);
  34.  $xml_output .= "<image src=\"images/tn/";
  35.  $xml_output .= "".$row['smallpic']."";
  36.  $xml_output .= "\" title=\"\" url=\"images/";
  37.  $xml_output .= "".$row['Pic1']."";
  38.  $xml_output .=" \">\n";
  39. }
  40.  $xml_output .= "</images>";
  41. echo $xml_output;
  42. ?> 
Newbie
 
Join Date: Oct 2009
Posts: 15
#5: 6 Days Ago

re: Sliding menu of images


Expand|Select|Wrap|Line Numbers
  1. echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
  2.  $xml_output .= "<images>\n";
  3.  for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){
  4.  $row = mysql_fetch_assoc($resultID);
  5.  $xml_output .= "<image src=\"images/tn/";
  6.  $xml_output .= "".$row['smallpic']."";
  7.  $xml_output .= "\" title=\"\" url=\"images/";
  8.  $xml_output .= "".$row['Pic1']."";
  9.  $xml_output .=" \" />\n";
  10. }
  11. $xml_output .= "</images>";
  12. echo $xml_output;
  13.  ?> 
Newbie
 
Join Date: Oct 2009
Posts: 15
#6: 5 Days Ago

re: Sliding menu of images


thread closed as I got it all working fully automatically
Reply


Similar PHP bytes