News for hackers. Stuff that matters.
Re:SQL Tips and Tricks by freilanzer on Wednesday September 25, 2024 @08:47AM (#41646815)
Php has nothing like this?

In [1]: "... WHERE " + " AND ".join(str(i) for i in range(4))

Out[1]: '... WHERE 0 AND 1 AND 2 AND 3'

Very strange.

Re:SQL Tips and Tricks by egormakarov on Wednesday September 25, 2024 @10:00AM (#41647637)
This will produce broken SQL on empty clauses list. Very strange.
Re:SQL Tips and Tricks by freilanzer on Thursday September 26, 2024 @02:45AM (#41655233)
You're quite right, but this is easily fixed. That doesn't change my question, since something like this is much easier that the other logic.
Re:SQL Tips and Tricks by paperplatter on Thursday September 26, 2024 @12:42PM (#41660521)
The easiest fix for this is the "WHERE 1=1" or "WHERE true"