php - Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING -
i trying retrieve data database , show data in table header in text mail function,but getting error:
parse error: syntax error, unexpected ']', expecting t_string or t_variable or t_num_string
can tell how fix 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'; // localhost $dbusername = 'xxxx'; $dbpassword = 'xxxxxxxxx'; $dbdatabase = 'xxxxxxxxxxxx'; $db = mysql_connect($dbhost, $dbusername, $dbpassword) or die ("unable connect database server."); mysql_select_db ($dbdatabase, $db) or die ("could not select database."); $columnnames = mysql_query('select clientid client_list order `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 connect database server.\"); mysql_select_db ($dbdatabase, $db) or die (\"could not select database.\");
or use single quotes
Comments
Post a Comment