php-general Digest 24 Sep 2009 05:05:57 -0000 Issue 6355

2009-09-23 Thread php-general-digest-help
php-general Digest 24 Sep 2009 05:05:57 - Issue 6355 Topics (messages 298289 through 298306): Re: NULLS vs Empty result in PHP 298289 by: Bastien Koert Re: How to take output from an include, and embed it into a variable? 298290 by: Ben Dunlap 298292 by: Jim Lucas

RE: [PHP] Re: How to take output from an include, and embed it into a variable?

2009-09-23 Thread Mert Oztekin
Output buffering will do it. Also I am not sure but did you try retrieving content with fopen() ? Something like $file = 'invoicetable_bottom.php'; fopen(http://yoursite.com/folder/$file,r;); http://tr.php.net/function.fopen worth trying. Easier than output buffering -Original

[PHP] Re: How to take output from an include, and embed it into a variable?

2009-09-23 Thread Puiu Hrenciuc
Hi, The simplest way (actually the single way I know :) ) would be to capture the output using output buffering functions, something like this: // start output buffering ob_start(); // include the file that generates the HTML (or whatever content) include ; // get output buffer content

[PHP] NULLS vs Empty result in PHP

2009-09-23 Thread Dan Shirah
Morning! Just a quick question. Say I have a column in my database that could contain NULLS, empty spaces, or an actual value. If I do: $my_query = SELECT my_column FROM my_database WHERE 1 = 1; $my_result = ifx_query($my_query, $connect_id); while($row = ifx_fetch_row($my_result)) {

RE: [PHP] NULLS vs Empty result in PHP

2009-09-23 Thread Samrat Kar
Use var_dump before processing your result. Regards, Samrat Kar FRD, BARC Tel: 022-25597295 Alternate Email: esam...@yahoo.com -Original Message- From: Dan Shirah [mailto:mrsqua...@gmail.com] Sent: Wednesday, September 23, 2009 5:28 PM To: PHP General Subject: [PHP] NULLS vs Empty

[PHP] Re: NULLS vs Empty result in PHP

2009-09-23 Thread Ralph Deffke
using empty() is ´the right way to check a var for NULL or however, it also depends what MySQL has got as setuo definition for empty fields. on textfields u can define an epmty string as default. ralph_def...@yahoo.de Dan Shirah mrsqua...@gmail.com wrote in message

Re: [PHP] Re: NULLS vs Empty result in PHP

2009-09-23 Thread Dan Shirah
using empty() is ´the right way to check a var for NULL or however, it also depends what MySQL has got as setuo definition for empty fields. on textfields u can define an epmty string as default. So say these are the first three results of my query: some text //The column actually has

Re: [PHP] Re: NULLS vs Empty result in PHP

2009-09-23 Thread Robert Cummings
Ralph Deffke wrote: using empty() is ´the right way to check a var for NULL or Empty will also match a string containing 0. And, to me, that doesn't at all seem empty :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List

RE: [PHP] Re: NULLS vs Empty result in PHP

2009-09-23 Thread Mert Oztekin
if it can take only numeric values u can use is_numeric() also i suggest that you not to use nulls in dbs. instead, use not null and default value property. Its more simple and more effective for both managing your database and coding your program. -Original Message- From: Robert

RE: [PHP] Re: NULLS vs Empty result in PHP

2009-09-23 Thread Ashley Sheridan
On Wed, 2009-09-23 at 16:34 +0300, Mert Oztekin wrote: if it can take only numeric values u can use is_numeric() also i suggest that you not to use nulls in dbs. instead, use not null and default value property. Its more simple and more effective for both managing your database and coding

[PHP] Re: Dom PDF Problem

2009-09-23 Thread Chris Wilson
This might help some people struggling with memory leak problems in DOMPDF. I haven't fixed it but it seems to have reduced the memory leak considerably. I have done 2 things: 1. Added a detruct function to the DOMPDF file in dompdf.cls.php where I unset everything. I call this each time in my

[PHP] Parse error: syntax error, unexpected ''

2009-09-23 Thread Haig Davis
Good morning Everyone, I'm have trouble with a simple HTML Checkbox list. I keep getting *Parse error*: syntax error, unexpected ''. I'm sure I'm doing something really simple and basic wrong I just cannot seem to see what it is, any assistance is appreciated. Script: form method=post

Re: [PHP] Extract links from strings

2009-09-23 Thread Philip Thompson
On Sep 21, 2009, at 6:20 PM, Jim Lucas wrote: Jim Lucas wrote: Jônatas Zechim wrote: Hi there, i've the following strings: $string1 = 'Lorem ipsum dolor http://site.com sit amet'; $string2 = 'Lorem ipsum dolor http://www.site.com/ sit amet'; $string3 = 'Lorem ipsum dolor http://www.site.net

Re: [PHP] NULLS vs Empty result in PHP

2009-09-23 Thread Philip Thompson
On Sep 23, 2009, at 9:48 AM, Dan Shirah wrote: From reading the other responses to this thread, it seems that you want to skip or exclude rows in the results where my_column === null. If this is correct, why not do it in the SELECT statement to begin with? $my_query = SELECT my_column

Re: [PHP] NULLS vs Empty result in PHP

2009-09-23 Thread Bastien Koert
On Wed, Sep 23, 2009 at 11:35 AM, Philip Thompson philthath...@gmail.com wrote: On Sep 23, 2009, at 9:48 AM, Dan Shirah wrote: From reading the other responses to this thread, it seems that you want to skip or exclude rows in the results where my_column === null. If this is correct, why

Re: [PHP] Re: How to take output from an include, and embed it into a variable?

2009-09-23 Thread Ben Dunlap
$file = 'invoicetable_bottom.php'; fopen(http://yoursite.com/folder/$file,r;); http://tr.php.net/function.fopen worth trying. Easier than output buffering Easier in what sense? It would end up requiring more code than output-buffering because you'd have to read from the file after calling

Re: [PHP] Extract links from strings

2009-09-23 Thread Jim Lucas
Philip Thompson wrote: On Sep 21, 2009, at 6:20 PM, Jim Lucas wrote: Jim Lucas wrote: Jônatas Zechim wrote: Hi there, i've the following strings: $string1 = 'Lorem ipsum dolor http://site.com sit amet'; $string2 = 'Lorem ipsum dolor http://www.site.com/ sit amet'; $string3 = 'Lorem ipsum

Re: [PHP] Re: How to take output from an include, and embed it into a variable?

2009-09-23 Thread Jim Lucas
Ashley Sheridan wrote: On Wed, 2009-09-23 at 07:36 -0700, Jim Lucas wrote: Mert Oztekin wrote: Output buffering will do it. Also I am not sure but did you try retrieving content with fopen() ? Something like $file = 'invoicetable_bottom.php'; fopen(http://yoursite.com/folder/$file,r;);

[PHP] Stricter Error Checking?

2009-09-23 Thread Tim Legg
Hello, I just spent way, way to much time trying to debug code due to a misnamed element. Here is a simplified example of the problem I dealt with. $test = SELECT * FROM `Materials` WHERE `Part_Number` = '125664'; $result = mysql_query($test,$handle); if(!$result)

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Jonathan Tapicer
Hi, There is, see here (or it can also be set through php.ini): http://www.php.net/manual/en/function.error-reporting.php You are looking for E_STRICT. Regards, Jonathan On Wed, Sep 23, 2009 at 3:11 PM, Tim Legg kc0...@yahoo.com wrote: Hello, I just spent way, way to much time trying to

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Tommy Pham
- Original Message From: Tim Legg kc0...@yahoo.com To: php-general@lists.php.net Sent: Wednesday, September 23, 2009 11:11:46 AM Subject: [PHP] Stricter Error Checking? Hello, I just spent way, way to much time trying to debug code due to a misnamed element. Here is a

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Jonathan Tapicer
I think he meant that he is using 'Number' instead of 'Part_Number' when accessing the array and not in the SQL, his SQL was correct, this was wrong: echo $row['Number']; E_STRICT catches that kind of error. Jonathan On Wed, Sep 23, 2009 at 3:28 PM, Tommy Pham tommy...@yahoo.com wrote:

RE: [PHP] Stricter Error Checking?

2009-09-23 Thread Bob McConnell
From: Tommy Pham From: Tim Legg I just spent way, way to much time trying to debug code due to a misnamed element. Here is a simplified example of the problem I dealt with. $test = SELECT * FROM `Materials` WHERE `Part_Number` = '125664'; $result = mysql_query($test,$handle);

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Tommy Pham
- Original Message From: Bob McConnell r...@cbord.com To: Tommy Pham tommy...@yahoo.com; php-general@lists.php.net Sent: Wednesday, September 23, 2009 11:37:00 AM Subject: RE: [PHP] Stricter Error Checking? From: Tommy Pham From: Tim Legg I just spent way, way to much time

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Shawn McKenzie
I think the problem is that he didn't check that the key he used actually existed before using the value it pointed to. So he got an empty string for $row['Number']; because the key should have been 'Part_Number'. I don't know that even E_STRICT would catch that one. Bob McConnell What?

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Shawn McKenzie
Bob McConnell wrote: From: Tommy Pham From: Tim Legg I just spent way, way to much time trying to debug code due to a misnamed element. Here is a simplified example of the problem I dealt with. $test = SELECT * FROM `Materials` WHERE `Part_Number` = '125664'; $result =

[PHP] Re: Stricter Error Checking?

2009-09-23 Thread Shawn McKenzie
Tim Legg wrote: Hello, I just spent way, way to much time trying to debug code due to a misnamed element. Here is a simplified example of the problem I dealt with. $test = SELECT * FROM `Materials` WHERE `Part_Number` = '125664'; $result = mysql_query($test,$handle);

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Jim Lucas
Tim Legg wrote: Hello, I just spent way, way to much time trying to debug code due to a misnamed element. Here is a simplified example of the problem I dealt with. $test = SELECT * FROM `Materials` WHERE `Part_Number` = '125664'; $result = mysql_query($test,$handle);

Re: [PHP] Re: session.gc_maxlifetime

2009-09-23 Thread Tom Worster
there's a need for long timeouts in this app but could perhaps be reduced from 6 to 3 hours. the sessions are cookie based using php's 'file' handler and session.cookie_lifetime=0. the server appears to have plenty of free memory and appears not to have swapped in nearly a year of uptime. load

Re: [PHP] Re: session.gc_maxlifetime

2009-09-23 Thread Ralph Deffke
finaly we went with a custom cooky handling, however the customers requirements where two days. if u are shure that the server is still the same hardware like it has been 6 years ago then it might be some client stuff, however if there are other applications, pages running (virtual servers) then

Re: [PHP] User Account Management

2009-09-23 Thread Waynn Lue
Thanks so much for all the feedback! Ben's comment was something that prompted this discussion to begin with internally, in that we didn't want to reinvent the wheel, nor make a mistake in the security implenetation of our solution. I've forwarded this thread back internally, and we'll take this

RE: [PHP] Stricter Error Checking?

2009-09-23 Thread Samrat Kar
Better use mysqli rather mysql. It supports all new features of MySQL. I solved the problem in following manner. 1. Detect the return value of mysqli-query function. 2. If it is FALSE get the error no, error msg etc and store in a Mysql table for further review. You can also write it in a error