我有一个mysql数据库,其中保存了产品名称,价格和详细信息。这是使用PHP完成的。它工作正常。
我只需要使用AS3将产品及其细节的图像加载到闪存中。
这是我的PHP代码:
<?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; ?>
任何帮助将不胜感激。
由于
答案 0 :(得分:0)
1.-使用PHP和SQL生成XML文件
- &GT; http://code.activestate.com/recipes/576499-converting-mysql-queries-to-xml/
2.-使用Flash / Flex显示数据,而不是从XML获得的数据
- &GT; http://www.republicofcode.com/tutorials/flash/as3xml/
3.-运用你的想象力并产生一些伟大的东西:
- &GT; http://www.republicofcode.com/tutorials/flash/as3slideshow/