in reply to Explain SQL statement
$sql = "SELECT * FROM tbl_admin WHERE day = '$d' AND month = '$m_num' and year = '$y' AND expal IN (" .join(',',keys %expal). ") AND status= '2'";
I've reformatted this to make it clearer. The WHERE clause includes an "x in (list)" expression. The join command is constructing the list from the keys of the hash, separated by commas. If the hash happens to be empty, you get invalid or dubious SQL.
The SQL is being constructed by concatenating three expressions, one of which is a Perl join statement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Explain SQL statement
by Anonymous Monk on May 26, 2004 at 13:42 UTC | |
by hardburn (Abbot) on May 26, 2004 at 14:00 UTC | |
by herveus (Prior) on May 26, 2004 at 13:58 UTC | |
by Anonymous Monk on May 26, 2004 at 14:06 UTC | |
by herveus (Prior) on May 26, 2004 at 14:08 UTC | |
by Anonymous Monk on May 26, 2004 at 14:58 UTC | |
by Anonymous Monk on May 26, 2004 at 14:29 UTC | |
by Roy Johnson (Monsignor) on May 26, 2004 at 14:35 UTC |