【发布时间】:2014-03-10 07:57:25
【问题描述】:
我正在尝试从数据库中检索数据并在文本邮件功能的表头中显示该数据,但我收到错误消息:
Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING
谁能告诉我如何解决这个错误
我的代码:
$text_mail.= "<table style='margin:0px'>
<tr>
<th>Country</th>
<th>Networkname </th>
<th>Mcc</th>
<th>Mnc</th>
<th>Oldprice </th>
<th>Newprice </th>
<th>Comments </th>
<?php
$dbHost = 'localhost'; // usually localhost
$dbUsername = 'xxxx';
$dbPassword = 'xxxxxxxxx';
$dbDatabase = 'xxxxxxxxxxxx';
$db = mysql_connect($dbHost, $dbUsername, $dbPassword) or die ("Unable to connect to Database Server.");
mysql_select_db ($dbDatabase, $db) or die ("Could not select database.");
$ColumnNames = mysql_query('select clientid from client_list ORDER BY `clientid` ASC') or die('mysql error');
$columnArray=array();
$i=0;
while($data3=mysql_fetch_array($ColumnNames))
{
$columnArray[]=$data3[0];
echo '<th style='width:67px;' class='. $columnArray[$i] .' >" . $columnArray[$i] . "
</th>';
echo'<th></th>';
$i++;
}
?>
</tr>";
【问题讨论】:
-
希望在发布代码时出现错误但您忘记关闭
评论 "; -
语法高亮说明。
标签: php sendmail html-email