首页 > IT职业 > > 我不知道代码哪里错了
<?php
$link=@mysql_connect("localhost","root","root");
mysql_select_db("pro_info",$link) or die("不能选择数据库,".mysql_error());
$cname=$_POST["proname"];
echo $cname;//这句话可以显示
$where="";
$where="where name like '%$cname%'";
$sql="select *from product $where";
$query=mysql_query($sql) or die(mysql_error());
while($row=mysql_fetch_array($query))
{
echo $row['id'].$row[1].$row[2]."<br>";
}
?>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/97/viewspace-3157642/ ,如需转载,请注明出处,否则将追究法律责任。