- stack
- Nov 28, 2000
-
|
Is there a way to catch 'Ctrl-C' in a PHP CLI script running in Windows? PCNTL isn't available for Windows so I can't easily use it to catch the signal for it. Google only turns up one post on php.net where a guy made a custom build of PHP to include PCTNL and that won't work for my situation.
|
#
¿
Apr 10, 2008 20:40
|
|
- Adbot
-
ADBOT LOVES YOU
|
|
#
¿
May 6, 2024 03:41
|
|
- stack
- Nov 28, 2000
-
|
Safety Shaun posted:
Thanks for the pointers sirs, now I have another annoyance.
The more questions they answer, the more likely it is that a question they've already answered will come up. If I store which q_ids they do in a string inside a cookie or session, is it possible with a simple query to do a
SELECT * FROM questions WHERE q_id != $IN_THIS_ARRAY() ORDER BY rand( ) LIMIT 1
Or something similar?
code:SELECT * FROM questions WHERE q_id NOT IN (x, y, z) ORDER BY RAND() LIMIT 1;
Use implode() to turn your array into a comma separated list which I represented above with 'x, y, z'.
|
#
¿
Aug 4, 2008 02:49
|
|