这是我的表结构:
id name value
1 questions 50
2 duration 120
现在,我想根据名称显示值。但我无法正确执行SQL语句。这是我的尝试:
$qry = "SELECT * FROM (
SELECT (SELECT value FROM pq_examsettings) as duration,
(SELECT value FROM pq_examsettings) as questions
) ";
$result= mysql_query($qry);
$row = mysql_fetch_array($result);
$duration = $row['duration'];
$questions = $row['questions'];
请有人帮我解决如何编写查询,以便我的$duration和$questions变量显示为120和50。