加载从MySQL的图像和数据到Flash使用PHP?图像、加载、数据、PHP

2023-09-08 15:06:12 作者:无人及你?

我有一个MySQL数据库所在的产品,价格和细节的名字被保存在那里。这是使用PHP。并能正常工作。

I have a mysql database where the name of the products and prices and details get saved on there. This is done using PHP. and it works fine.

我只需要使用AS3产品的形象和他们的详细信息加载到Flash中。

I just need to load the images of the products and their details into flash using AS3.

这是我的PHP code:

This is my PHP code:

<?php 
// Script Error Reporting
error_reporting(E_ALL);
ini_set('display_errors', '1');
?>
<?php 
// Run a select query to get my letest 6 items
// Connect to the MySQL database  
include "../config/connect_to_mysql.php"; 
$dynamicList = "";
$sql = mysql_query("SELECT * FROM products ORDER BY date_added DESC LIMIT 6");
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
    while($row = mysql_fetch_array($sql)){ 
             $id = $row["id"];
             $product_name = $row["product_name"];
             $price = $row["price"];
             $date_added = strftime("%b %d, %Y", strtotime($row["date_added"]));
             $dynamicList .= '<table width="100%" border="0" cellspacing="0" cellpadding="6">
        <tr>
          <td width="17%" valign="top"><a href="../product.php?id=' . $id . '"><img style="border:#666 1px solid;" src="../inventory_images/' . $id . '.jpg" alt="' . $product_name . '" width="77" height="102" border="1" /></a></td>
          <td width="83%" valign="top">' . $product_name . '<br />
            $' . $price . '<br />
            <a href="../product.php?id=' . $id . '">View Product Details</a></td>
        </tr>
      </table>';
    }
} else {
    $dynamicList = "We have no products listed in our store yet";
}
mysql_close();
?>
<?php echo $dynamicList; ?>

任何帮助将是AP preciated。

any help would be appreciated.

感谢

推荐答案

1:使用PHP和SQL生成一个XML文件

1.- Use PHP and SQL to generate a XML file

- > 的http:// code.activestate.com /食谱/ 576499-转换MySQL的-查询到XML /

2:使用Flash / Flex的比你从XML获得的显示数据。

2.- use Flash/Flex to display the data than you obtained from your XML

- > HTTP://www.republicof$c$c.com /教程/闪光灯/ as3xml /

3 .-用你的想象力,并产生一些伟大的东西:

3.- Use your imagination and generate some great stuff:

- > HTTP://www.republicof$c$c.com /教程/闪光灯/ as3slideshow /

 
精彩推荐
图片推荐