[PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Tamara Temple
I'm wondering what the advantages/disadvantage of using prepared statements with mysqli are. I'm used to using the mysqli::query and mysqli::fetch_assoc functions to deal with retrieving data and bulding my sql statement in php code. Tamara Temple -- aka tamouse__

Re: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Shreyas Agasthya
Tamara, In one of the earlier threads, it was mentioned mysqli APIs are more secure, faster, and actually maintained. Also, if you use some of the mysql_xxx(), you actually get a warning saying that it will be or it is being deprecated and paves the way for you to approach the same thing with

[PHP] Re: Apache mod_pagespeed

2010-11-04 Thread Colin Guthrie
'Twas brillig, and Daniel P. Brown at 03/11/10 19:34 did gyre and gimble: On Wed, Nov 3, 2010 at 14:48, Shreyas Agasthya shreya...@gmail.com wrote: Thiago, I would like to join this. Let me know how I can help you with this. Please be explicit with your requests so that we can totally test it

Re: [PHP] Problems converting strings with 0 to integer

2010-11-04 Thread Richard Quadling
On 3 November 2010 21:42, Alexander Holodny alexander.holo...@gmail.com wrote: To exclude unexcepted behavior in case of wrongly formated input data, it would be much better to use such type-casting method: intval(ltrim(trim($inStr), '0')) 2010/11/3, Nicholas Kell n...@monkeyknight.com: On

Re: [PHP] Problems converting strings with 0 to integer

2010-11-04 Thread Richard Quadling
On 4 November 2010 10:33, Richard Quadling rquadl...@gmail.com wrote: ?php // Create test file. $s_TabbedFilename = './test.tab'; file_put_contents($s_TabbedFilename, 0\t0002 . PHP_EOL . 4\t0004 . PHP_EOL); // Open test file. $fp_TabbedFile = fopen($s_TabbedFilename, 'rt') or

Re: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Richard Quadling
On 4 November 2010 08:19, Shreyas Agasthya shreya...@gmail.com wrote: Tamara, In one of the earlier threads, it was mentioned mysqli APIs are more secure, faster, and actually maintained. Also, if you use some of the mysql_xxx(), you actually get a warning saying that it will be or it is

Re: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Richard Quadling
On 4 November 2010 10:42, Richard Quadling rquadl...@gmail.com wrote: On 4 November 2010 08:19, Shreyas Agasthya shreya...@gmail.com wrote: Tamara, In one of the earlier threads, it was mentioned mysqli APIs are more secure, faster, and actually maintained. Also, if you use some of the

RE: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Jay Blanchard
[snip] If you have a query in your PHP code, which you are going to be executing a lot, even if you are using prepared statements, you can go one further by creating a stored procedure. Now the SQL server will only ever need to compile the statement once. No matter how many times it is used. You

[PHP] PHP sessions - users being automatically logged out

2010-11-04 Thread Paul Waring
I'm having trouble with a PHP site whereby some users are being logged out on a regular basis. This will usually happen after they have been using the site for a few minutes, they can login without any problems and access a few pages, but then suddenly they will request a page and be sent to

Re: [PHP] Re: Apache mod_pagespeed

2010-11-04 Thread Daniel P. Brown
On Thu, Nov 4, 2010 at 05:12, Colin Guthrie gm...@colin.guthr.ie wrote: Yeah it seems like a nice idea. Basically we already do a pre-process stage where we minify css and js before we deploy the application (dev versions are nicely verbose so that the javascript error on line 1 debugging

Re: [PHP] PHP sockets enabled but socket_create() gives an error call to undefined function

2010-11-04 Thread Suyash R
We added the extension=sockets.so to php.ini but it didn't work. However, the problem was there was no sockets.so extension anywhere to be found. i searched if I could install or add sockets.so extension. Couldn't find anything. Still looking for it. Thank you for all the help. -Suyash On

Re: [PHP] PHP sessions - users being automatically logged out

2010-11-04 Thread Alexander Holodny
Inc session.cache_expire. You have only 3 minutes. This means browser will drop cookie containing session id in three minutes, or even less, of clients inactivity. I prefer to set expire-time to zero. So, browser will never forget session id. In other case, if security requires, i usually set it

[PHP] Re: Apache mod_pagespeed

2010-11-04 Thread Colin Guthrie
'Twas brillig, and Daniel P. Brown at 04/11/10 14:36 did gyre and gimble: I'm already highly impressed with mod_pagespeed. It even removes excess spaces - such as those in br / tags - without any adverse reactions I've seen so far. Nice. I still stick spaces in my br / tags due to the parsing

Re: [PHP] PHP sessions - users being automatically logged out

2010-11-04 Thread Paul Waring
On 04/11/10 14:56, Alexander Holodny wrote: Inc session.cache_expire. You have only 3 minutes. This means browser will drop cookie containing session id in three minutes, or even less, of clients inactivity. According to the PHP manual: session.cache_expire specifies time-to-live for cached

Re: [PHP] Re: Apache mod_pagespeed

2010-11-04 Thread Daniel P. Brown
On Thu, Nov 4, 2010 at 10:58, Colin Guthrie gm...@colin.guthr.ie wrote: Nice. I still stick spaces in my br / tags due to the parsing error in IE(somethingold) but I'm pretty sure that was pre-IE6 and thus something I really don't care about now! That said, I'm not sure I'd really want it to

Re: [PHP] Problems converting strings with 0 to integer

2010-11-04 Thread robert mena
Hi, The core of the code is simply $fp = fopen('file.tab', 'rb'); while(!feof($fp)) { $line = fgets($fp); $data = explode(\t, $line); ... } So I try to manipulate the $data[X]. For example $data[0] is supposed to be numeric so I $n = (int) $data[0] One other thing if the second

[PHP] suhosin simulation blocks script

2010-11-04 Thread David Oros
Hello, I am searching through the internet how to work with suhosin. I am using debain lenny with apache2 and php 5.2 in production and my problem is: I have scripts that need for example exec() functions, but in general conf - suhosin.ini the exec function is disabled, so I turned on

Re: [PHP] Problems converting strings with 0 to integer

2010-11-04 Thread Richard Quadling
On 4 November 2010 15:11, robert mena robert.m...@gmail.com wrote: Hi, The core of the code is simply $fp = fopen('file.tab', 'rb'); while(!feof($fp)) {    $line = fgets($fp);    $data = explode(\t, $line);     ... } So I try to manipulate the $data[X].  For example $data[0] is supposed

Re: [PHP] suhosin simulation blocks script

2010-11-04 Thread Daniel P. Brown
2010/11/4 David Oros david.o...@platon.org: I have scripts that need for example exec() functions, but in general conf - suhosin.ini the exec function is disabled, so I turned on suhosin simulation mode. Now it is logging ALERT-SIMULATION messages in syslog, but it also blocks the scripts

Re: [PHP] Problems converting strings with 0 to integer

2010-11-04 Thread Richard Quadling
On 4 November 2010 15:31, robert mena robert.m...@gmail.com wrote: Hi Richard, I am not top posting.  I am just explaining other symptoms that may point to the cause since they may be the same and this is happening with the same file.  I'll try to get approval to release the file. Meanwhile,

[PHP] php-general-digest-unsubscr...@lists.php.net not working?

2010-11-04 Thread Marc Abramowitz
The bottom of my daily digest email says to unsubscribe, I should email php-general-digest-unsubscr...@lists.php.net I've done this several times -- sometimes with various combinations of blank and unsubscribe in the subject line and body. I keep getting the emails though. -- PHP General

Re: [PHP] suhosin simulation blocks script

2010-11-04 Thread David Oros
Hi, I am just wondering if anybody have the same experience. Yes, I noticed that the Suhosin forum is down for maintenance, as soon as possible I will write them too. Answer to the question about apache, yes I did restart it. It just doesn`t make any sense. Regards, -- David Oros System

Re: [PHP] php-general-digest-unsubscr...@lists.php.net not working?

2010-11-04 Thread Richard Quadling
On 4 November 2010 16:00, Marc Abramowitz ma...@yahoo-inc.com wrote: The bottom of my daily digest email says to unsubscribe, I should email php-general-digest-unsubscr...@lists.php.net I've done this several times -- sometimes with various combinations of blank and unsubscribe in the subject

Re: [PHP] php-general-digest-unsubscr...@lists.php.net not working?

2010-11-04 Thread Daniel P. Brown
On Thu, Nov 4, 2010 at 12:00, Marc Abramowitz ma...@yahoo-inc.com wrote: The bottom of my daily digest email says to unsubscribe, I should email php-general-digest-unsubscr...@lists.php.net I've done this several times -- sometimes with various combinations of blank and unsubscribe in the

Re: [PHP] php-general-digest-unsubscr...@lists.php.net not working?

2010-11-04 Thread Daniel P. Brown
On Thu, Nov 4, 2010 at 12:33, Daniel P. Brown daniel.br...@parasane.net wrote:    If you continue to have issues, let me know and I will remove you. From the list, that is, to be clear. Not the Earth. -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting

Re: [PHP] php-general-digest-unsubscr...@lists.php.net not working?

2010-11-04 Thread Steve Staples
On Thu, 2010-11-04 at 12:34 -0400, Daniel P. Brown wrote: On Thu, Nov 4, 2010 at 12:33, Daniel P. Brown daniel.br...@parasane.net wrote: If you continue to have issues, let me know and I will remove you. From the list, that is, to be clear. Not the Earth. i lol'd. -- PHP

[PHP] Chinese words on a PHP web page

2010-11-04 Thread Ernie Kemp
I’m writing a program that allows the user to click the flag and the test will change to that language and display. I’m trying to convert from English to Chinese using characters such as “ æ­“è¿Ž” The browser interprets these into, in this case, Japanese but my code needs to display in

Re: [PHP] Chinese words on a PHP web page

2010-11-04 Thread a...@ashleysheridan.co.uk
You could do it using the 1234; type codes, or copy it directly from another source, like a character map program. Bear in mind that if you do the latter, you'll need to output a utf 8 meta tag with the html output too. Thanks, Ash http://www.ashleysheridan.co.uk - Reply message -

Re: [PHP] suhosin simulation blocks script

2010-11-04 Thread Daniel P. Brown
On Thu, Nov 4, 2010 at 12:08, David Oros david.o...@platon.org wrote: Hi, I am just wondering if anybody have the same experience. Yes, I noticed that the Suhosin forum is down for maintenance, as soon as possible I will write them too. Answer to the question about apache, yes I did restart

Re: [PHP] PHP sockets enabled but socket_create() gives an error call to undefined function

2010-11-04 Thread Suyash R
On Tue, Nov 2, 2010 at 5:49 PM, Nathan Nobbe quickshif...@gmail.com wrote: On Tue, Nov 2, 2010 at 2:33 PM, Suyash R r.suy...@gmail.com wrote: No, we didn't try it our dept.'s admin wants to know where is sockets.so file on disk lol, tell your dept.'s 'admin' to run locate sockets.so

Re: [PHP] PHP sockets enabled but socket_create() gives an error call to undefined function

2010-11-04 Thread Nathan Nobbe
On Thu, Nov 4, 2010 at 11:11 AM, Suyash R r.suy...@gmail.com wrote: On Tue, Nov 2, 2010 at 5:49 PM, Nathan Nobbe quickshif...@gmail.comwrote: On Tue, Nov 2, 2010 at 2:33 PM, Suyash R r.suy...@gmail.com wrote: No, we didn't try it our dept.'s admin wants to know where is sockets.so file on

Re: [PHP] PHP sockets enabled but socket_create() gives an error call to undefined function

2010-11-04 Thread Nathan Nobbe
On Thu, Nov 4, 2010 at 11:43 AM, Nathan Nobbe quickshif...@gmail.comwrote: $ yum search php | grep -i socket php-pear-Net-Socket.noarch : Network Socket Interface check that - thats def *not* the package you're looking for, it's a userspace oo wrapper. you'd be best asking how to install

Re: [PHP] PHP sockets enabled but socket_create() gives an error call to undefined function

2010-11-04 Thread Steve Staples
On Thu, 2010-11-04 at 11:48 -0600, Nathan Nobbe wrote: On Thu, Nov 4, 2010 at 11:43 AM, Nathan Nobbe quickshif...@gmail.comwrote: $ yum search php | grep -i socket php-pear-Net-Socket.noarch : Network Socket Interface check that - thats def *not* the package you're looking for, it's a

Re: [PHP] Chinese words on a PHP web page

2010-11-04 Thread tedd
At 12:52 PM -0400 11/4/10, Ernie Kemp wrote: I'm writing a program that allows the user to click the flag and the test will change to that language and display. I'm trying to convert from English to Chinese using characters such as æ°©è¿Î The browser interprets these into, in this case,

Re: [PHP] php-general-digest-unsubscr...@lists.php.net not working?

2010-11-04 Thread Paul M Foster
On Thu, Nov 04, 2010 at 12:34:35PM -0400, Daniel P. Brown wrote: On Thu, Nov 4, 2010 at 12:33, Daniel P. Brown daniel.br...@parasane.net wrote:    If you continue to have issues, let me know and I will remove you. From the list, that is, to be clear. Not the Earth. Dang! I was

[PHP] Weird preg issue

2010-11-04 Thread Alex Nikitin
Hi, I'm kind of new to this list, and so if there have been discussions about this, i am not quite aware of them (i tried searching), but i ran across this issue and i figured it would be interesting enough to show you guys here: I was looking for a way to replace all the text in a string that

[PHP] How to code in PHP an onchange event in a select?

2010-11-04 Thread Tomás Corrales Lemoine
Hi, List, I have this two files (“index.php” and “include.php”). They both work fine, but I want to substitute the code for de onchange event in the select tag. Can I use PHP to code this event? How? Thanks. index.php: ?php echo 'htmlbody'; include_once 'include.php';

Re: [PHP] How to code in PHP an onchange event in a select?

2010-11-04 Thread Nicholas Kell
On Nov 4, 2010, at 3:23 PM, Tomás Corrales Lemoine wrote: Hi, List, I have this two files (“index.php” and “include.php”). They both work fine, but I want to substitute the code for de onchange event in the select tag. Can I use PHP to code this event? How? Thanks.

[PHP] Re: Weird preg issue

2010-11-04 Thread Alex Nikitin
Ah, i seem to have figured out the problem here... if you run a preg_match_all it will return [0] = Array ( [0] = And the cow says [1] = [2] = Moo [3] = ) And preg_replace is global by default, so in order for this to work

[PHP] Re: Weird preg issue

2010-11-04 Thread Alex Nikitin
but that doesnt work if you add something after the Mooo *sigh*. well it gets kept On Thu, Nov 4, 2010 at 3:47 PM, Alex Nikitin niks...@gmail.com wrote: Hi, I'm kind of new to this list, and so if there have been discussions about this, i am not quite aware of them (i tried

Re: [PHP] php-general-digest-unsubscr...@lists.php.net not working?

2010-11-04 Thread Kevin Kinsey
Paul M Foster wrote: On Thu, Nov 04, 2010 at 12:34:35PM -0400, Daniel P. Brown wrote: On Thu, Nov 4, 2010 at 12:33, Daniel P. Brown daniel.br...@parasane.net wrote: If you continue to have issues, let me know and I will remove you. From the list, that is, to be clear. Not the Earth.

Re: [PHP] How to code in PHP an onchange event in a select?

2010-11-04 Thread Bastien
On 2010-11-04, at 4:23 PM, Tomás Corrales Lemoine to...@hog.ecasa.avianet.cu wrote: Hi, List, I have this two files (“index.php” and “include.php”). They both work fine, but I want to substitute the code for de onchange event in the select tag. Can I use PHP to code this event?

RE: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Matt Graham
Jay Blanchard jblanch...@pocket.com didst scribe: using stored procedures has a lot of advantages. If you need to change your SQL you can do it in one spot. It reinforces MVS or modular coding behavior, the SP becomes very re-usable. Security is improved. Performance can be improved. You can

RE: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Jay Blanchard
[snip] Just don't go too far. [/snip] I absolutely agree! Doing SP's for SP sake is not desired and be truly careful about cascading the procedures. And always, ALWAYS document your code and put copious comments in the SP's. -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Alex Nikitin
One thing to remember is that dealing with results from prepared statements is different then getting results from queries, so if you are using both, confusion can easily set in (and lets face it, prepared statements arent always the best thing to use)... if its of any help, i have written a class

Re: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread knl
On Thu, 4 Nov 2010 02:48:55 -0500 Tamara Temple tam...@tamaratemple.com wrote: I'm wondering what the advantages/disadvantage of using prepared statements with mysqli are. I'm used to using the mysqli::query and mysqli::fetch_assoc functions to deal with retrieving data and bulding my sql

RE: [PHP] How to code in PHP an onchange event in a select?

2010-11-04 Thread admin
OnChange is Javascript. I might suggest you get yourself familiar with JQuery. JQuery makes your life a lot easier when there is a need for client browser interaction with site scripting. Richard L. Buskirk From: Tomás Corrales Lemoine [mailto:to...@hog.ecasa.avianet.cu]

Re: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Tamara Temple
On Nov 4, 2010, at 6:36 AM, Jay Blanchard wrote: [snip] If you have a query in your PHP code, which you are going to be executing a lot, even if you are using prepared statements, you can go one further by creating a stored procedure. Now the SQL server will only ever need to compile the