This is my table structure
id name value
1 questions 50
2 duration 120
Now, i want to display the value according to the name. I am unable to do the sql statement correct. This is what i have done:
$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'];
Somebody help me on how i can do my query such that my $duration and $questions variables display 120 and 50.