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
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
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
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)) {
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
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
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
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
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
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
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
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
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
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
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
$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
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
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;);
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)
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
- 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
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:
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);
- 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
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?
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 =
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);
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);
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
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
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
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
32 matches
Mail list logo