求问这条语句是否可行!
SELECT * FROM city WHERE city.pname=$row_a['pname']
Copy after login
$row_a['pname']为另一个表格的变量,求问这条句语可行否,如果出错,错在哪
------解决方案--------------------你那个$row_a['pname']是从PHP程序中传来的吧,改成这样就能执行了,大概
<br />
$sql="SELECT * FROM city WHERE city.pname='$row_a['pname']";<br />
$result=mysql_query($sql);<br />
Copy after login
如果单纯用MYSQL,则需要把$row_a['pname']换成特定的值,如
SELECT * FROM city WHERE city.pname='A'
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn