tarun


{ City } chandigarh
< Country > india
* Profession * php programmer
User No # 78049
Total Questions Posted # 0
Total Answers Posted # 2

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 3
Users Marked my Answers as Wrong # 2
Questions / { tarun }
Questions Answers Category Views Company eMail




Answers / { tarun }

Question { Yardi, 321034 }

how to find the second highest salary from emp table?


Answer

SELECT salary FROM tb_salary ORDER BY salary DESC LIMIT 2,1

Is This Answer Correct ?    0 Yes 0 No

Question { IBM, 27741 }

what is the diffrence between for and foreach?


Answer

foreach is used to iterate over arrays and for loop is used
to run statement for number of times and there is another
major difference is in foreach you want to execute statement
which comes from an database with id which is
autoincremented and you run for loop over it and suppose in
the mean time i delete 3rd rows i.e. 3rd id than what will
this loop stops working but not in foreach and foreach is
the faster than for loop..

Is This Answer Correct ?    3 Yes 2 No