[PHP] Re: Sort problem
use natsort.
RE: [PHP] Re: Sort problem
Yeah well, it is indeed sometimes, for someone a bit sleepy yet rather responsible hehe. Btw, m new here, need to get my head around soon i guess. Cheers. From: marc.g...@gmail.com Date: Thu, 15 Sep 2011 07:54:00 -0400 CC: php-general@lists.php.net Subject: Re: [PHP] Re: Sort problem use natsort. For the repetitive answers specialists: Is it possible that 15 hours later someone is still only seeing the original question? Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Stop PHP execution on client connection closed
You can use ajax. Date: Tue, 13 Sep 2011 09:22:54 -0400 From: eric.but...@gmail.com To: ma...@lanzotti.com CC: php-general@lists.php.net Subject: Re: [PHP] Re: Stop PHP execution on client connection closed On Tue, Sep 13, 2011 at 4:01 AM, Marco Lanzotti ma...@lanzotti.com wrote: Il 13/09/2011 09:39, vikash.i...@gmail.com ha scritto: You can use ob_start() to start output buffering and ob_end_flush() to send some data in the middle of script - that way your php script will send some data to the client earlier than finishing execution and hence detect the aborted connection. The question is: how can I send data to client until I'm waiting for query execution? PHP thread support is not available in Apache enviroment. Bye, Marco -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Flush all buffers you have. Sometimes you have to do nasty hacks like send a certain number of characters. Execution will still continue along after your buffers are send if it is still blocking for a query. You might have better luck if you search for 'comet' or 'long polling.' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Querying a database for 50 users' information: 50 queries or a WHERE array?
select * from table where userID in(1,2,3,etc) From: a...@ashleysheridan.co.uk Date: Tue, 13 Sep 2011 15:29:26 +0100 To: dotanco...@gmail.com; php-general@lists.php.net Subject: Re: [PHP] Querying a database for 50 users' information: 50 queries or a WHERE array? Dotan Cohen dotanco...@gmail.com wrote: I have a MySQL database table with about 10,000 rows. If I want to query for 50 specific users (so no LIMIT ORDER BY) then I seem to have these choices: 1) SELECT * FROM table This will pull in all 10,000 rows, not nice! 2) foreach ($user as $u) { mysql_query(SELECT * FROM table WHERE userID=.$u); } This will lead to 50 queries, again not nice! (maybe worse) 3) foreach ($user as $u) { $whereClause+= OR userID=.$u; } This makes a huge SQL query. However, this is the method that I'm using now. Is there some sort of array that can be passed in the WHERE clause, containing all the userID's that I am interested in? Thanks! -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php SELECT * FROM table WHERE userID IN (1,2,3,4,5,etc) Much smaller than what you proposed in #3, and easier to make if your user is list is already an array. Thanks, Ash http://www.ashleysheridan.co.uk -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php