Getting from database from 2 conditions ?
Posted: Mon Nov 20, 2006 10:01 am
Hi guys,
can you please help me with this. I want to get a particular row from DB mysql.But I want to check 2 conditions.Presently it does not return the required value.
I want to check for a particular "sl_no " after getting the datas from the DB.
Please help.
can you please help me with this. I want to get a particular row from DB mysql.But I want to check 2 conditions.Presently it does not return the required value.
Code: Select all
$query = "SELECT * FROM `nt_students` WHERE `wo`='$WorkOrderNumber';";
$result = mysql_query($query)
while($row=mysql_fetch_array($result)){
$d_sl_no=$row['sl_no']; //from data base
//echo '................$d_sl_no='.$d_sl_no;
if($d_sl_no=$sl_no){
echo '................$d_sl_no='.$d_sl_no;
$f_name=$row['f_name'];
$l_name=$row['l_name'];
$standard = $row['standard'];
$division= $row['division'];
$date_of_birth=$row['date_of_birth'];
$date_of_submission=$row['date_of_submission'];
$home_address=$row['home_address'];
$home_phone=$row['home_phone'];
$mobile=$row['mobile'];
$e_mail=$row['e_mail'];
$mom_cell=$row['mom_mobile'];
$mom_e_mail=$row['mom_e_mail'];
$dad_cell=$row['dad_mobile'];
$dad_e_mail=$row['dad_e_mail'];
$sp_notes=$row['sp_notes'];
$undertaking_parent=$row['parent_undertaking'];
$is_jain=$row['is_jain'];
$is_swimmer=$row['is_swimmer'];
$bus_no=$row['bus_no'];
$gender=$row['gender'];Please help.