Page 1 of 1

SQL

Posted: Thu Aug 15, 2002 10:50 pm
by prasadharischandra
my code is this
for($i=0;$i<=$count_number_of;$i++){
$checklist_pass= mysql_query("SELECT *
FROM pase_res WHERE (pas_dep_flight='$flight_list_no' and pas_dep_status='B' and pas_dep_board_seq='$i') or ( pas_rtn_flight='$flight_list_no'and pas_rtn_status='B' and pas_rtn_board_seq='$i')")or die(mysql_error());
}
what's wrong
no errors comming variables and other datafiels are right
problem is under this sql some records are not comming

Posted: Fri Aug 16, 2002 1:47 am
by twigletmac
Since I do not have access to your data and have no idea about your table layout it makes it difficult to say what would be wrong with the SQL statement if it is syntactically correct - that is that it does not cause any errors. I would suggest that you do this:

Code: Select all

$sql = "SELECT * FROM pase_res WHERE (pas_dep_flight='$flight_list_no' and pas_dep_status='B' and pas_dep_board_seq='$i') or ( pas_rtn_flight='$flight_list_no'and pas_rtn_status='B' and pas_rtn_board_seq='$i')";
echo $sql;
$checklist_pass= mysql_query($sql) or die(mysql_error());
To check that the right variables are being passed.

Mac