Friday, 15 January 2010

confusing with mysql Nested Select Query using php -



confusing with mysql Nested Select Query using php -

please help find error here. beginner.. help me..

$query1="select sub_code,sub_name subj_mast dept_id='(select dep_id academic reg_no=$reg)' , sem='$sem'";

the above query not working when split working...

$query2="select dep_id academic reg_no=$reg"; $query3="select sub_code,sub_name subj_mast dept_id='104' , sem='$sem'";

here 104 dept_id corresponds reg_no given. 104 got using query2. confused lot ... query1 right???

you're wrapping subquery within of quotes. remove quotes.

eg:

$query1="select sub_code,sub_name subj_mast dept_id=(select dep_id academic reg_no=$reg) , sem='$sem'";

php mysql sql database

No comments:

Post a Comment