我是PHP新手并尝试使用以下代码:
" . "Subject : {$row['subject']}
" . "Message : {$row['message']}
"; "ARTICLE_NO :{$row['ARTICLE_NO']}
" . "ARTICLE_NAME :{$row['ARTICLE_NAME']}
" . "SUBTITLE :{$row['SUBTITLE']}
" . "CURRENT_BID :{$row['CURRENT_BID']}
" . "START_PRICE :{$row['START_PRICE']}
" . "BID_COUNT :{$row['BID_COUNT']}
" . "QUANT_TOTAL :{$row['QUANT_TOTAL']}
" . "QUANT_SOLD :{$row['QUANT_SOLD']}
" . "STARTS :{$row['STARTS']}
" . "ENDS :{$row['ENDS']}
" . "ORIGIN_END :{$row['ORIGIN_END']}
" . "SELLER_ID :{$row['SELLER_ID']}
" . "BEST_BIDDER_ID :{$row['BEST_BIDDER_ID']}
" . "FINISHED :{$row['FINISHED']}
" . "WATCH :{$row['WATCH']}
" . "BUYITNOW_PRICE :{$row['BUYITNOW_PRICE']}
" . "PIC_URL :{$row['PIC_URL']}
" . "PRIVATE_AUCTION :{$row['PRIVATE_AUCTION']}
" . "AUCTION_TYPE :{$row['AUCTION_TYPE']}
" . "INSERT_DATE :{$row['INSERT_DATE']}
" . "UPDATE_DATE :{$row['UPDATE_DATE']}
" . "CAT_1_ID :{$row['CAT_1_ID']}
" . "CAT_2_ID :{$row['CAT_2_ID']}
" . "ARTICLE_DESC :{$row['ARTICLE_DESC']}
" . "DESC_TEXTONLY :{$row['DESC_TEXTONLY']}
" . "COUNTRYCODE :{$row['COUNTRYCODE']}
" . "LOCATION :{$row['LOCATION']}
" . "CONDITIONS :{$row['CONDITIONS']}
" . "REVISED :{$row['REVISED']}
" . "PAYPAL_ACCEPT :{$row['PAYPAL_ACCEPT']}
" . "PRE_TERMINATED :{$row['PRE_TERMINATED']}
" . "SHIPPING_TO :{$row['SHIPPING_TO']}
" . "FEE_INSERTION :{$row['FEE_INSERTION']}
" . "FEE_FINAL :{$row['FEE_FINAL']}
" . "FEE_LISTING :{$row['FEE_LISTING']}
" . "PIC_XXL :{$row['PIC_XXL']}
" . "PIC_DIASHOW :{$row['PIC_DIASHOW']}
" . "PIC_COUNT :{$row['PIC_COUNT']}
" . "ITEM_SITE_ID :{$row['ITEM_SITE_ID']}; } include 'closedb.php'; ?>
但是我收到此错误:
Parse error: syntax error, unexpected $end in C:\Programme\EasyPHP 2.0b1\www\test.php on line 56
我还想知道是否有更简单的方法来获取mysql记录而不是手动输入?
编辑:
我修复了分号和引号问题,现在得到:
Parse error: syntax error, unexpected T_STRING in C:\Programme\EasyPHP 2.0b1\www\test.php on line 51
对不起,我不知道如何在代码中制作颜色.
编辑
你说你还在收到错误.你还记得加一个.当你删除多余的分号?
你的字符串中间有一个分号,后面有两行.
此外,字符串的结尾缺少双引号.
至于输出所有值的更简洁的方法,你可以循环遍历结果数组,如下所示:
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { foreach($row as $field=>$value) { echo "$field: {$value}
"; } }