I have two tables Question and Option having one to many relationship. after fetching the result from the two tables the resulted array should be like this
Question = array(
//result from the Question TableOption = array( //result from the Option Table ));
Suppose If i want to fetch the 10 Question from database then i can do this in two ways (i think)
-
By Joining the Two Tables and fetch the data from database and the process with it PHP Loops and control.(i preferred this)
-
By fetching
Questionthen firing the 10 query forOption. (it would be easy because we don’t need to process as in case of 1)
i want to know which is better to process the Result in PHP or use SQL Queries.
Generally, writing one join query is much better: