簡體   English   中英

麻煩定義PHP腳本

[英]trouble defining php script

我在為數據庫和兩個表(RecipeDB和IngredientDB)定義php腳本時遇到問題,我的php腳本似乎不顯示db的內容。 我嘗試用為主鍵RecipeID連接兩個表。 但是由於某些原因,當我為簡單的表編寫查詢時它不起作用,但不適用於兩個表,請事先幫助我

$conn = mysql_connect("...") or die(mysql_error());

mysql_select_db("a7956343_FoodP", $conn);

$sql = 'SELECT * FROM `RecipeDB`, `IngredientDB` WHERE      
`RecipeDB.RecipeID`=`IngredientDB.RecipeID`';

$xml = new XmlWriterer();
$xml->push('recipes');

if ($result = mysql_query($sql))
{
while($Recipe = mysql_fetch_row($result))
{
    $xml->push('Recipe');
            $xml->element('RecipeID', $RecipeDB[0]);
    $xml->element('Name', $RecipeDB[1]);
    $xml->element('Category', $RecipeDB[2]);
            $xml->element('Origin', $RecipeDB[3]);
    $xml->element('Recipe', $RecipeDB[4]);
    $xml->element('Image', $RecipeDB[5]);
            $xml->element('Favorite', $RecipeDB[6]);
            $xml->element('Image', $RecipeDB[7]);
          $xml->element('Ingredient', $IngredientDB[8]);
           $xml->element('Quantity', $IngredientDB[9]);
            $xml->pop();
}

}

您所需XmlWriterer()就是在它的file.php中更改XmlWriterer()的類名! 希望能對您有所幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM