我有一个数据库表。我想进行文本输入,用户可以在其中输入“uid”,查询将返回与该 uid 关联的行。
所以假设我有这样的事情:
$query = "SELECT name,age FROM people WHERE uid = '2' LIMIT 0,1";
$result = mysql_query($query);
$res = mysql_fetch_assoc($result);
echo $res["age"];
我将如何将该查询修改为..
SELECT name, age
FROM people
WHERE uid = $_POST['blahblah'] LIMIT 0,1
在此先感谢您的帮助!