Jordy
Jordy

Reputation: 4809

How to make this nested select query?

how can I make this work?

$current_id=5;
SELECT Id FROM table1 WHERE Output='yes' and Time>(SELECT Time FROM table2 WHERE Id="'.$current_id.'") ORDER BY Time

Thanks!

Upvotes: 0

Views: 84

Answers (1)

qrazi
qrazi

Reputation: 1391

Verify that $current_id actually has a value. Then check whether the subquery returns a value.

The query itself looks proper

Upvotes: 1

Related Questions