SQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
prasadharischandra
Forum Commoner
Posts: 57
Joined: Thu May 09, 2002 2:19 am
Location: sri lanka
Contact:

SQL

Post 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
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
Post Reply