php-general Digest 14 Sep 2011 07:39:27 -0000 Issue 7477

2011-09-14 Thread php-general-digest-help
php-general Digest 14 Sep 2011 07:39:27 - Issue 7477 Topics (messages 314812 through 314834): Re: Querying a database for 50 users' information: 50 queries or a WHERE array? 314812 by: Dotan Cohen 314813 by: Dotan Cohen 314814 by: Dotan Cohen 314815 by: Dotan

Re: [PHP] Re: htmlentities

2011-09-14 Thread Johan Lidström
On 13 September 2011 23:01, Shawn McKenzie nos...@mckenzies.net wrote: On 09/13/2011 01:38 PM, Ron Piggott wrote: Is there a way to only change accented characters and not HTML (Example: p /p a href =”” /a ) The syntax echo htmlentities(

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 brad.husk...@gmail.com 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

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

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 niks...@gmail.com 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

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 chetan.d.r...@gmail.com 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

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 tamouse.li...@gmail.com wrote: On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings rob...@interjinn.com 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

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 rquadl...@gmail.com wrote: On 14 September 2011 01:23, tamouse mailing lists tamouse.li...@gmail.com wrote: On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings rob...@interjinn.com wrote: I'm a big fan of editors that work in the terminal. You'll get

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

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 dotanco...@gmail.com wrote: On Wed, Sep 14, 2011 at 06:05, chetan rane chetan.d.r...@gmail.com 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

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 t...@clothears.org.uk wrote: On 14 Sep 2011 at 12:40, Richard Quadling rquadl...@gmail.com wrote: On 14 September 2011 01:23, tamouse mailing lists tamouse.li...@gmail.com wrote: On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings rob...@interjinn.com

[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: ?php $serie[] = Two And Half Man Season 1; $serie[] = Two And Half Man Season 4; $serie[] = Two And Half Man Season 2; $serie[] = Two And Half Man Season 3; $serie[] = Two And Half Man

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

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 http://www.twitter.com/igorescobar On Wed, Sep 14, 2011 at 12:02 PM, Marc Guay marc.g...@gmail.com wrote: Anyone know a

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

2011-09-14 Thread Jim Giner
But why? Brad Huskins brad.husk...@gmail.com 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] 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 count

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 is

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 rquadl...@gmail.com wrote: On 14 September 2011 01:23, tamouse mailing lists tamouse.li...@gmail.com wrote: On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings rob...@interjinn.com

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 ja...@nixsecurity.org 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 tamouse mailing lists
On Wed, Sep 14, 2011 at 11:52 AM, Paul M Foster pa...@quillandmouse.com 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,

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 ma...@lanzotti.com 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

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] 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 what

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 pa...@quillandmouse.com 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

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 eric.but...@gmail.com 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

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 niks...@gmail.com 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

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

2011-09-14 Thread Alex Nikitin
rant from=tired of constantly having to explain it, developer 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

[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 t...@clothears.org.uk wrote: On 14 Sep 2011 at 12:40, Richard Quadling rquadl...@gmail.com wrote: On 14 September 2011 01:23, tamouse wrote: On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings

[PHP] Dereferencing an array.

2011-09-14 Thread Richard Quadling
Hi. Based upon ... ?php $name = Null; $age = Null; $boundParams = array('name' = $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

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

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

2011-09-14 Thread Joshua Stoutenburg
On Wed, Sep 14, 2011 at 11:59 AM, Govinda govinda.webdnat...@gmail.com 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