-4

我的表名是“新”,它有 3 行,ID 名称和标题,我还有一个变量“嗨”。如果“新”表中的“标题”行中的变量 $hi(introduce) == value(introduce),mysql 查询是什么。然后回声介绍。

$hi ="introduce";

--------------------- 
id | name | title |
---------------------
 1 | hi   | introduce
 2 | hello| tell me 
4

2 回答 2

3

不知道 echo 但您可以选择 title=introduce 的所有行,如下所示:

SELECT * FROM new WHERE title = 'introduce';
于 2012-07-29T12:59:34.533 回答
2
$query = "select * from `new` where `title` = '$hi'";
于 2012-07-29T12:59:31.127 回答