$sql="select * from met_img where title='$imtitle'";
1.确认数据库正常链接 2.输出SQL到mysql 终端 测试结果echo "select * from met_img where title='.$imtitle.'"; exit();
老大告诉你了 sql 语句写错了$sql="select * from met_img where title='$imtitle'"; 修改成 $sql="select * from met_img where title='".$imtitle."'";不过怎么也不可能没任何提示空白吧,嘿嘿
$sql="select * from met_img where title='.$imtitle.'";,这个地方有问题。''里边的内容会原样显示,不会处理变量。
no,你错了,会处理的,因为是在大的双引号中的。lz的错误是因为连接符用错了导致括号没有相应匹配。$sql="select * from met_img where title='".$imtitle."'";或者$sql="select * from met_img where title='$imtitle'";ps:都是php代码,加那么多开始结束标签干吗?不嫌罗嗦么?<?php mysql_connect('127.0.0.1','sheng','xxx'); mysql_select_db('sheng');$imtitle = ''; $imtitle = $_POST['searchword']; $sql="select * from met_img where title='$imtitle'"; $query=mysql_query($sql); $row=mysql_fetch_array($query); echo $row['imgurl'];?>
2.输出SQL到mysql 终端 测试结果echo "select * from met_img where title='.$imtitle.'";
exit();
老大告诉你了 sql 语句写错了$sql="select * from met_img where title='$imtitle'";
修改成
$sql="select * from met_img where title='".$imtitle."'";不过怎么也不可能没任何提示空白吧,嘿嘿
no,你错了,会处理的,因为是在大的双引号中的。lz的错误是因为连接符用错了导致括号没有相应匹配。$sql="select * from met_img where title='".$imtitle."'";或者$sql="select * from met_img where title='$imtitle'";ps:都是php代码,加那么多开始结束标签干吗?不嫌罗嗦么?<?php
mysql_connect('127.0.0.1','sheng','xxx');
mysql_select_db('sheng');$imtitle = '';
$imtitle = $_POST['searchword']; $sql="select * from met_img where title='$imtitle'";
$query=mysql_query($sql);
$row=mysql_fetch_array($query);
echo $row['imgurl'];?>