[PHP] Re: Sort problem

2011-09-14 Thread yeer tai
use natsort.

Re: [PHP] Re: Repetitive answers . . .

2011-09-14 Thread Joshua Stoutenburg
On Wed, Sep 14, 2011 at 11:59 AM, Govinda wrote: >> As for duplicate answers..., > >> [snip] > > > Also newbies may tend to like the multiples answers.. for the different > perspectives, as Dan said, but also when they are exact dupe answers - > because then the newbie knows the answer is defini

Re: [PHP] Dereferencing an array.

2011-09-14 Thread Alex Nikitin
it's only marginally faster, but it does look a bit cleaner, and is a bit more memory efficient: $records[] = unserialize(serialize($boundParams)); -- The trouble with programmers is that you can never tell what a programmer is doing until it’s too late.  ~Seymour Cray On Wed, Sep 14, 2011 at

[PHP] Dereferencing an array.

2011-09-14 Thread Richard Quadling
Hi. Based upon ... &$name, 'age' => &$age); $records = array(); $name = 'Richard'; $age = 43; $records[] = $boundParams; $name = 'Sally'; $age = 37; $records[] = $boundParams; print_r($records); ?> outputs Sally twice. Whilst that is the correct output based upon the code, it is undesired

[PHP] Re: What would you like to see in most in a text editor?

2011-09-14 Thread Jonesy
On Wed, 14 Sep 2011 14:08:09 +0100, Richard Quadling wrote: > On 14 September 2011 13:18, Tim Streater wrote: >> On 14 Sep 2011 at 12:40, Richard Quadling wrote: >>> On 14 September 2011 01:23, tamouse wrote: On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings wrote: > I'm a big fan of edit

Re: [PHP] Querying a database for 50 users' information: 50 queries or a WHERE array?

2011-09-14 Thread Alex Nikitin
MySQL real escape string doesn't work, it's a bad solution to the problem that has been with the internets since the very beginning, and if people program like they are taught to by books, doesn't look like it's going away any time soon. The problem of course is that various programming languages

Re: [PHP] Querying a database for 50 users' information: 50 queries or a WHERE array?

2011-09-14 Thread Dotan Cohen
On Wed, Sep 14, 2011 at 21:01, Alex Nikitin wrote: > You can use a limit with a nested select, you just can't use it in > some cases, like inside an "IN" statement, but something like this > should work: > > SELECT id, data, etc FROM table JOIN (SELECT special_id as id FROM > special_table ORDER B

Re: [PHP] Querying a database for 50 users' information: 50 queries or a WHERE array?

2011-09-14 Thread Dotan Cohen
On Wed, Sep 14, 2011 at 16:02, Eric Butera wrote: > Just out of curiosity, where are these ids coming from?  Doing a raw > implode on them like that is a sql injection vuln. > They are in an array. I do of course is_int() them first, plus some other sanitation including mysql_real_escape_string()

Re: Re: Re: [PHP] What would you like to see in most in a text editor?

2011-09-14 Thread Tim Streater
On 14 Sep 2011 at 17:52, Paul M Foster wrote: > Eventually I switched to Vim (counter-intuitively) because 1) there's no > *unix variant on which it's not available; 2) at some point, you're > probably going to *have* to know how to operate Vi if you move around > among foreign machines and netw

Re: [PHP] Re: Repetitive answers . . .

2011-09-14 Thread Govinda
> As for duplicate answers..., > [snip] Also newbies may tend to like the multiples answers.. for the different perspectives, as Dan said, but also when they are exact dupe answers - because then the newbie knows the answer is definitive.. and then stops asking the list.. and starts doing wha

Re: [PHP] Querying a database for 50 users' information: 50 queries or a WHERE array?

2011-09-14 Thread Alex Nikitin
You can use a limit with a nested select, you just can't use it in some cases, like inside an "IN" statement, but something like this should work: SELECT id, data, etc FROM table JOIN (SELECT special_id as id FROM special_table ORDER BY special_id LIMIT 0, 1000) AS table2 USING (id) Note: syntax

Re: [PHP] Stop PHP execution on client connection closed

2011-09-14 Thread Alex Nikitin
On Wed, Sep 14, 2011 at 4:04 AM, Marco Lanzotti wrote: > Il 13/09/2011 20:58, Alex Nikitin ha scritto: > > Correction on Marco's post. You can absolutely stop a mysql query > > I know I can stop a query, but I don't know how to realize HTTP client > has closed connection during query execution. >

Re: Re: [PHP] What would you like to see in most in a text editor?

2011-09-14 Thread tamouse mailing lists
On Wed, Sep 14, 2011 at 11:52 AM, Paul M Foster wrote: > BTW, my big beef with "online" editors is latency, and it's a *huge* > problem, as far as I'm concerned. Ultimately this is why I wrote blog > software for myself which requires you to compose and edit your posts > locally, and then *upload*

Re: [PHP] What would you like to see in most in a text editor?

2011-09-14 Thread tamouse mailing lists
On Tue, Sep 13, 2011 at 7:56 PM, James Yerge wrote: > I'd have to go agree with the exception of s/emacs/vi/ :P invoke(EditorChoiceReligiousArgument); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: [PHP] What would you like to see in most in a text editor?

2011-09-14 Thread Paul M Foster
On Wed, Sep 14, 2011 at 01:18:00PM +0100, Tim Streater wrote: > On 14 Sep 2011 at 12:40, Richard Quadling wrote: > > On 14 September 2011 01:23, tamouse mailing lists > > wrote: > >> On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings > >> wrote: > >>> I'm a big fan of editors that work in the

Re: [PHP] Stop PHP execution on client connection closed

2011-09-14 Thread Marco Lanzotti
Il 14/09/2011 17:35, Jim Lucas ha scritto: > > SELECT ... FROM ... WHERE ... AND (1=1 OR 'unique value'); > > add 'unique value' to your session data and then, when the person changes the > selected fields and starts to execute another query, first, you could search > to > see if an SQL statement

Re: [PHP] Stop PHP execution on client connection closed

2011-09-14 Thread Jim Lucas
On 9/14/2011 1:04 AM, Marco Lanzotti wrote: > Il 13/09/2011 20:58, Alex Nikitin ha scritto: >> Correction on Marco's post. You can absolutely stop a mysql query > > I know I can stop a query, but I don't know how to realize HTTP client > has closed connection during query execution. > > My query

Re: [PHP] What would you like to see in most in a text editor?

2011-09-14 Thread Jim Giner
But why? "Brad Huskins" wrote in message news:66.b1.08893.200a0...@pb1.pair.com... > > I am aiming to build something that is almost as easy to use as Notepad. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Sort problem

2011-09-14 Thread Igor Escobar
Wow! Thank you! I completely forgot this method! Regards, Igor Escobar *Software Engineer * + http://blog.igorescobar.com + http://www.igorescobar.com + @igorescobar On Wed, Sep 14, 2011 at 12:02 PM, Marc Guay wrote: > > Anyone know a smart way to orde

Re: [PHP] Sort problem

2011-09-14 Thread Marc Guay
> Anyone know a smart way to order file names? Nope, but I know a "natural" way: http://ca.php.net/manual/en/function.natsort.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Sort problem

2011-09-14 Thread Igor Escobar
Hi Folks! Anyone know a smart way to order file names? An example to you guys picture what im saying is: The result of this snippet is: Array ( [0] => Two And Half Man Season 1[1] => Two And Half Man Season 10[2] => Two And Half Man Season 2 [3] => Two And Half Man Season 3

Re: Re: [PHP] What would you like to see in most in a text editor?

2011-09-14 Thread Richard Quadling
On 14 September 2011 13:18, Tim Streater wrote: > On 14 Sep 2011 at 12:40, Richard Quadling wrote: > >> On 14 September 2011 01:23, tamouse mailing lists >> wrote: >>> On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings >>> wrote: I'm a big fan of editors that work in the terminal. >>> >>> Yo

Re: [PHP] Querying a database for 50 users' information: 50 queries or a WHERE array?

2011-09-14 Thread Eric Butera
On Wed, Sep 14, 2011 at 4:12 AM, Dotan Cohen wrote: > On Wed, Sep 14, 2011 at 06:05, chetan rane wrote: >> Hi, >> >> There are 2 peoblems with subselect >> >> 1. You cant use a limit on the nested select >> 2. Id the number of elements in the in clause exceeds the subselect buffer >> you will run

Re: [PHP] What would you like to see in most in a text editor?

2011-09-14 Thread Brad Huskins
Thanks Tim. That is some very useful feedback. I am aiming to build something that is almost as easy to use as Notepad. Don't know if I'll be successful or not, but nice to know people value simplicity. --Brad. On 09/14/2011 08:18 AM, Tim Streater wrote: On 14 Sep 2011 at 12:40, Richard Qu

Re: Re: [PHP] What would you like to see in most in a text editor?

2011-09-14 Thread Tim Streater
On 14 Sep 2011 at 12:40, Richard Quadling wrote: > On 14 September 2011 01:23, tamouse mailing lists > wrote: >> On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings >> wrote: >>> I'm a big fan of editors that work in the terminal. >> >> You'll get my emacs when you pry it out of my cold dead hand

Re: [PHP] What would you like to see in most in a text editor?

2011-09-14 Thread Richard Quadling
On 14 September 2011 01:23, tamouse mailing lists wrote: > On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings wrote: >> I'm a big fan of editors that work in the terminal. > > You'll get my emacs when you pry it out of my cold dead hands. Pah! You and your full screen editor. EDLIN is the way to

Re: [PHP] Querying a database for 50 users' information: 50 queries or a WHERE array?

2011-09-14 Thread Dotan Cohen
On Wed, Sep 14, 2011 at 06:05, chetan rane wrote: > Hi, > > There are 2 peoblems with subselect > > 1. You cant use a limit on the nested select > 2. Id the number of elements in the in clause exceeds the subselect buffer > you will run into performance issues ans eventually you query will be > do

Re: [PHP] Querying a database for 50 users' information: 50 queries or a WHERE array?

2011-09-14 Thread Dotan Cohen
On Tue, Sep 13, 2011 at 23:04, Alex Nikitin wrote: > Dotan, > > IN (the function used in all of the queries above) is not the same as an > INNER_JOIN, inner join joins 2 tables, as you have already described, IN > however is a function that return 1 if the value being searched for is in > the arra

Re: [PHP] Stop PHP execution on client connection closed

2011-09-14 Thread Marco Lanzotti
Il 13/09/2011 20:58, Alex Nikitin ha scritto: > Correction on Marco's post. You can absolutely stop a mysql query I know I can stop a query, but I don't know how to realize HTTP client has closed connection during query execution. My query count how many records match selected fields in a 50M rec

Re: [PHP] What would you like to see in most in a text editor?

2011-09-14 Thread Johan Lidström
On 13 September 2011 21:56, Brad Huskins wrote: > Hello all you php coders out there, > > I'm doing an Open Source text editor (just a hobby) that's designed for PHP > developers and is accessible through the web. This has been stewing for a > while, and has gotten to the point where I can use it

Re: [PHP] Re: htmlentities

2011-09-14 Thread Johan Lidström
On 13 September 2011 23:01, Shawn McKenzie wrote: > On 09/13/2011 01:38 PM, Ron Piggott wrote: > > > > Is there a way to only change accented characters and not HTML (Example: > ) > > > > The syntax > > > > echo htmlentities( > stripslashes(mysql_result($whats_new_result,0,"message")) ) . "\r