我尝试用PHP进行查询,但我认为我犯了一个错误。 当我连续回声时,我看到任何东西,您能帮我吗? :)
MYSQL-表格:
+----+-------+--------------------+----------+--------+
| id | user | tool | waarde | status |
+----+-------+--------------------+----------+--------+
| 1 | BEN | ticker_text | #FFF | 1 |
| 2 | BEN | ticker_background | #00aeef | 1 |
+----+-------+--------------------+----------+--------+
PHP:
$user = $_GET['user'];
$text_sql = "SELECT * FROM optie WHERE user='$user' AND tool='ticker_text'";
$text_row = $mysqli->query($text_sql);
echo $text_row['waarde'];
答案 0 :(得分:4)
您需要从查询中获取结果集,然后对其进行迭代:
$result = $mysqli->query($text_sql);
while ($text_row = $result->fetch_array()) {
echo $text_row['waarde'];
}