<?
$con=mysql_connect("127.0.0.1,root,root");
mysql_select_db("datebase");//datebase 数据库名
$str=$_POST['name'];
$sql="select * from date_log where Number=$str";//date_log 数据表名
$query=mysql_query($sql,$con)
while($row=mysql_fetch_array($query))
{
echo $row['level'];
}
echo 自定义字符串?>
程序运行后错误提示:Parse error: syntax error, unexpected T_WHILE in D:\www\1.php on line 7表单提交Html代码:
<html>
<body><form action="1.php" method="post">
name: <input type="text" name="name" />
<input type="submit" />
</form></body>
</html>
$con=mysql_connect("127.0.0.1,root,root");
mysql_select_db("datebase");//datebase 数据库名
$str=$_POST['name'];
$sql="select * from date_log where Number=$str";//date_log 数据表名
$query=mysql_query($sql,$con)
while($row=mysql_fetch_array($query))
{
echo $row['level'];
}
echo 自定义字符串?>
程序运行后错误提示:Parse error: syntax error, unexpected T_WHILE in D:\www\1.php on line 7表单提交Html代码:
<html>
<body><form action="1.php" method="post">
name: <input type="text" name="name" />
<input type="submit" />
</form></body>
</html>
解决方案 »
- HI,我是一个PHP新手,今天一个问题折腾了一上午,请大家帮我看一下,万分感谢
- phyMyAdmin访问mysql被拒绝了,错误信息2013
- 有个Cookie跨域名享用相汉。大家帮我参考下
- PHP+MYSQL生成动态表单
- php中if判断成立的条件
- no database selected??
- 怎么在linux 8.0上安装php并且让他可以连接mysql啊?
- 我用PHP内嵌了一个HTML文件,HTML文字可以显示,图片却不能显示,请问该怎么办?
- 谁知道用PHP做在线人员统计的原理
- 任意代码执行如何修复
- 在htdocs 下创建一个test.php,在IE中输入http://127.0.0.1:80/test.php 显示找不到网页呢
- PHP 如何提交时,做敏感词汇判断?
$sql="select * from date_log where Number=$str";
如果你的$str是字符串的话要加引号引起来
$sql="select * from date_log where Number='{$str}'";