我使用PHP和mysqli连接到MySQL数据库,我使用此命令进行SELECT:
SELECT value AS txt FROM `variables21` WHERE name = 'db_gold::$uuid'
以下代码中的$ gold应该返回500
这是phpMyAdmin中的内容,它返回@@
。
代码:
$query = "SELECT value AS txt FROM `variables21` WHERE name = 'db_gold::$uuid'";
$result = mysqli_query($conn, $query) or trigger_error("Query Failed! SQL: $query - Error: ". mysqli_error($conn), E_USER_ERROR);
if($result) {
while($row = mysqli_fetch_assoc($result)) {
$gold = $row['txt'];
}
}
思想?