执行显示客户下拉列表时出现:syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
2012-02-24 09:44
676 查看
$result=mysql_query($sql,$conn);
while($row=mysql_fetch_array($result))
{
echo '<option>'.$row['department'].'</option>';//输出部门名
}
原来它是在HTML里写的,正确写法
<td><select name='Depart'>
<option>所有部门</option>";
$conn=mysql_connect('localhost','root','%$!**') or die('连接失败'); //连接服务器
mysql_select_db('lnwatchpc',$conn) or die('连接数据库失败'); //选择数据库
mysql_query('SET NAMES utf8'); //设置字符集
$sql='select department from depart';
$result=mysql_query($sql,$conn);
while($row=mysql_fetch_array($result))
{
echo '<option>'.$row['department'].'</option>';//输出部门名
}
echo "
</select></td>
while($row=mysql_fetch_array($result))
{
echo '<option>'.$row['department'].'</option>';//输出部门名
}
原来它是在HTML里写的,正确写法
<td><select name='Depart'>
<option>所有部门</option>";
$conn=mysql_connect('localhost','root','%$!**') or die('连接失败'); //连接服务器
mysql_select_db('lnwatchpc',$conn) or die('连接数据库失败'); //选择数据库
mysql_query('SET NAMES utf8'); //设置字符集
$sql='select department from depart';
$result=mysql_query($sql,$conn);
while($row=mysql_fetch_array($result))
{
echo '<option>'.$row['department'].'</option>';//输出部门名
}
echo "
</select></td>
相关文章推荐
- PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
- syntax error, unexpected ''&expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NU
- Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable
- thinkphp syntax error, unexpected ')', expecting T_VARIABLE or '$'
- 可执行程序无法在Linux上运行,显示line 1: syntax error: word unexpected (expecting ")
- 可执行程序无法在Linux上运行,显示line 1: syntax error: word unexpected (expecting ")" )
- 可执行程序无法在Linux上运行,显示line 1: syntax error: word unexpected (expecting ")
- phpcms Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE错误
- tp3.2报错(T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING
- phpcms Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE错误
- PHP expecting T_STRING or T_VARIABLE or T_NUM_STRING
- 可执行程序无法在Linux上运行,显示line 1: syntax error: word unexpected (expecting ")
- 可执行程序无法在Linux上运行,显示line 1: syntax error: word unexpected (expecting ") .
- 可执行程序无法在Linux上运行,显示line 1: syntax error: word unexpected (expecting ")
- Go报错 : syntax error: unexpected string, expecting comma or )
- 【已解决】可执行程序无法在Linux上运行,显示line 1: syntax error: word unexpected (expecting ")
- delphi ADVStringGrid 怎么显示下拉列表
- js解析XML文件,并将城市显示在下拉列表,选中城市后出现城市介绍
- delphi ADVStringGrid 怎么显示下拉列表
- 在执行shell脚本时,出现“syntax error : unexpected end of file"错误的解决方法