[英]Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING
I am trying to retrieve data from database and show that data in the table header in the text mail function,but i am getting an error: 我试图从数据库中检索数据,并在文本邮件功能的表标题中显示该数据,但出现错误:
Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING
can anyone tell how to fix this error 谁能告诉我如何解决此错误
my code : 我的代码:
$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>";
correct these: 更正这些:
$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.\");
or use single quotes 或使用单引号
if this is not a typo error then you need to add ending " (double quote) after 如果这不是拼写错误,则需要在后面添加结尾“(双引号)
change 更改
$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>
to
$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
标记,因为您已经在php中
Remove php tag after ending . 结束后删除php标签。 change
更改
$text_mail.= " Country Networkname Mcc Mnc Oldprice $ text_mail。=“国家/地区网络名称Mcc Mnc旧价格
Newprice 新的价格
Comments 评论
to 至
$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> ";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.