-3

html (変数も含む) をエコーする必要があり、解析エラーが発生し続けます: 構文エラー、予期しない T_CONSTANT_ENCAPSED_STRING、',' または ';' が必要です。

while ($line1 = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo '<h1 align = "center"><strong>Section:</strong></h1>.''.'<h1align="center"><strong>$line1   ['section_id']</strong></h1>';} 

基本的に、Section: を読み取るために必要です (そして、Section ID に対して取得されたものはすべて 1 行で)。このような状況でhtmlを出力するための最良の方法は何ですか?

4

2 に答える 2

0

あなたのコードは難破船です。これを試して:

while ($line1 = mysql_fetch_array($result, MYSQL_ASSOC)) {
    echo '<h1 align = "center"><strong>Section:</strong></h1><h1 align="center"><strong>' . $line1['section_id'] . '</strong></h1>';
}
于 2012-04-24T19:07:29.630 に答える
0
while ($line1 = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo '<h1 align = "center"><strong>Section:</strong></h1><h1align="center">    <strong>' . $line1 . ' ' .  ['section_id'] .'</strong></h1>';} 

どうぞ

于 2012-04-24T19:08:00.090 に答える