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

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

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 ave

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,$handl

[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,$handl

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'

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

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Tommy Pham
- Original Message > From: Bob McConnell > To: Tommy Pham ; 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 trying to debug cod

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

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 wrote: > > > - Original

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Tommy Pham
- Original Message > From: Tim Legg > 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 simplified ex

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 wrote: > Hello, > > I just spent way, way to much time trying to debug code due

[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] 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://yours

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'; >>

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

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 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 n

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_col

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 s

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

2009-09-23 Thread Dan Shirah
> > 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. > > It's a CHAR (60) field. This

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

2009-09-23 Thread Ashley Sheridan
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","

Re: [PHP] NULLS vs Empty result in PHP

2009-09-23 Thread Dan Shirah
> > 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 FROM my_database WHERE my_column IS NO

Re: [PHP] NULLS vs Empty result in PHP

2009-09-23 Thread Jim Lucas
Dan Shirah wrote: > 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

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

2009-09-23 Thread Jim Lucas
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";); > > http://tr.php.net/function.fopen > > worth trying. Easier

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

2009-09-23 Thread Fernando Castillo Aparicio
Reading again, it's not just one miss. You have to close some strings, escape some quotes, etc I think this can be right: $sql = "SELECT * FROM melstatus WHERE custID=$custID ORDER BY aircraftRegistration"; $q = mysql_query($q) or die ("could not execute query."); echo "

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

2009-09-23 Thread Ashley Sheridan
On Wed, 2009-09-23 at 07:18 -0700, Haig Davis wrote: > echo " ".$row['melID']." name="\".$row['melID].\""/input> "; You're escaping in the wrong places. The \ escapes the character following it, so what you are doing here, in line 2, is breaking out of the string with a regular " and then printing

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

2009-09-23 Thread Fernando Castillo Aparicio
You missed a double quote here: echo " \n"; De: Haig Davis Para: php-general@lists.php.net Enviado: miércoles, 23 de septiembre, 2009 16:18:17 Asunto: [PHP] Parse error: syntax error, unexpected '>' Good morning Everyone, I'm have trouble wi

[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: http://bw.org/misc/cgi-tes

[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 l

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

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 C

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 (htt

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 actual

[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" wrote in message news:a16da1ff0909230458o30d66186m75fc4fd0d19

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 res

[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)) { $my_c

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 Message

[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 $