php-general Digest 24 Feb 2009 19:02:37 -0000 Issue 5977

2009-02-24 Thread php-general-digest-help
php-general Digest 24 Feb 2009 19:02:37 - Issue 5977 Topics (messages 288726 through 288744): Re: Why PHP won 288726 by: Michael A. Peters 288728 by: Per Jessen 288741 by: Michael A. Peters 288742 by: Per Jessen 288743 by: Michael A. Peters Re:

Re: [PHP] optimizing space for array of booleans

2009-02-24 Thread leledumbo
Just tried serializing array of 256 booleans and printing the length, it really shocked me: 2458. This project will be used by about 500 students, so in the worst case (all students enroll all courses) it will eat 500 * 2458 (assuming one character eats one byte) = 1229000 Bytes ~= 1.2 MB. Not a

Re: [PHP] Unexpected results using ksort on arrays in which the keys are mixed alphanumeric strings.

2009-02-24 Thread Jochem Maas
Clancy schreef: I have been experimenting using four character alphanumeric keys on an array, and when I generated a random set of keys, and then used ksort to sort the array, I was very surprised to find that if the key contained any non-numeric character, or if it started with zero,

Re: [PHP] PDO buffered query problem

2009-02-24 Thread Thodoris
Stewart Duncan wrote: Hi there, I'm having some serious problems with the PHP Data Object functions. I'm trying to loop through a sizeable result set (~60k rows, ~1gig) using a buffered query to avoid fetching the whole set. No matter what I do, the script just hangs on the PDO::query() -

RE: [PHP] help installing phpDocumentor

2009-02-24 Thread Bob McConnell
From: Jim Lucas I may be wrong, but I heard short tags were going the way of the Dodo bird as of PHP6. This is not surprising. With the advent of XHTML, the short tag option collides with another valid tag, ?xml. So that option has to be turned off as soon as you need any XML in your pages.

[PHP] Re: how to deal with multiple authors for one book

2009-02-24 Thread PJ
Reinhardt Christiansen wrote: From: PJ af.gour...@videotron.ca To: MySql my...@lists.mysql.com Subject: how to deal with multiple authors for one book Date: Mon, 16 Feb 2009 17:20:54 -0500 In my db there are a number of books with several authors; so, I am wondering how to set up a table

Re: [PHP] help installing phpDocumentor

2009-02-24 Thread 9el
--- Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get a Free CD of Ubuntu mailed to your door without any cost. Visit : www.ubuntu.com --

Re: [PHP] optimizing space for array of booleans

2009-02-24 Thread Andrew Ballard
On Tue, Feb 24, 2009 at 3:24 AM, leledumbo leledumbo_c...@yahoo.co.id wrote: Just tried serializing array of 256 booleans and printing the length, it really shocked me: 2458. This project will be used by about 500 students, so in the worst case (all students enroll all courses) it will eat 500

[PHP] XML and :

2009-02-24 Thread Merlin Morgenstern
Hi there, I am trying to pars an XML file with php. This works if the xml tag looks like this: anbieternr88/anbieternr In that case I retrieve the info: $xml-anbieternr But now the tag looks different like this: imo:anbieternr88/imo:anbieternr The command $xml-imo:anbieternr does not work

Re: [PHP] Re: multiple choice dropdown box puzzle

2009-02-24 Thread PJ
Bob McConnell wrote: From: PJ Here's my test page and, so far, nothing works... Please expound on nothing works What do you see in the browser? What do you see in the server logs? It's not in the browser that I look, rather in the db: nothing is INSERTed. I have confirmed

Re: [PHP] XML and :

2009-02-24 Thread Andrew Ballard
On Tue, Feb 24, 2009 at 9:51 AM, Merlin Morgenstern merli...@fastmail.fm wrote: Hi there, I am trying to pars an XML file with php. This works if the xml tag looks like this: anbieternr88/anbieternr In that case I retrieve the info: $xml-anbieternr But now the tag looks different like this:

[PHP] Re: RecursiveDirectoryIterator and foreach

2009-02-24 Thread Nathan Rixham
Ryan Panning wrote: I have discovered that when I foreach over a RecursiveDirectoryIterator (see example below) the $item actually turns into a SplFileInfo object. I would expect it to be a RecursiveDirectoryIterator. How do I do a hasChildren() on SplFileInfo? seems like expected

Re: [PHP] File Write Operation Slows to a Crawl....

2009-02-24 Thread Jochem Maas
I read that you already got your script performance up, but I'd still like to suggest that you shouldn't be reading in a complete 18Mb file (especially given that you don't know in advance whether some day(s) this size might be much larger). instead you should be opening a handle to the file and

Re: [PHP] Why PHP won

2009-02-24 Thread Michael A. Peters
Per Jessen wrote: Michael A. Peters wrote: [anip] and you can use DOMDocument to completely construct the page before sending it to the browser - allowing you to translate xhtml to html for browsers that don't properly support xhtml+xml. I suspect you meant translate xml to html? I publish

Re: [PHP] Why PHP won

2009-02-24 Thread Per Jessen
Michael A. Peters wrote: Per Jessen wrote: Michael A. Peters wrote: [anip] and you can use DOMDocument to completely construct the page before sending it to the browser - allowing you to translate xhtml to html for browsers that don't properly support xhtml+xml. I suspect you meant

Re: [PHP] Why PHP won

2009-02-24 Thread Michael A. Peters
Per Jessen wrote: I don't use any of them, but I thought even IE6 was able to deal with xml. What happens is IE6 (and I believe IE7) asks the user what application they want to open the file with if it receives an xml+xhtml header. IE does parse xhtml but only if sent with an incorrect

[PHP] SimpleXML

2009-02-24 Thread Alex Chamberlain
Hi, I am trying to write a PHP interface to ISBNdb.com. When I make a certain request, the following is returned ISBNdb server_time=2009-02-24T18:57:31Z BookList total_results=1 page_size=10 page_number=1 shown_results=1 BookData book_id=language_proof_and_logic isbn=157586374X

Re: [PHP] File Write Operation Slows to a Crawl....

2009-02-24 Thread Shawn McKenzie
Jochem Maas wrote: I read that you already got your script performance up, but I'd still like to suggest that you shouldn't be reading in a complete 18Mb file (especially given that you don't know in advance whether some day(s) this size might be much larger). instead you should be opening

Re: [PHP] XML and :

2009-02-24 Thread mike
On Tue, Feb 24, 2009 at 6:51 AM, Merlin Morgenstern merli...@fastmail.fm wrote: The command $xml-imo:anbieternr does not work in that case. Has somebody an idea how to adress this? you could cheat and string replace the node prefix in the document imo: to imo_ and then you can use simplexml.

[PHP] omg help...insane simple query won't work I must be blind

2009-02-24 Thread Terion Miller
Ok guys, I'm going blind indeed, this is a simple tiny query that goes to a form and I get the error : Error, insert query failed ever since I added the fields StartDate and EndDate and advertiser what is going on here is the php ?php $ebits = ini_get('error_reporting');

RE: [PHP] help installing phpDocumentor

2009-02-24 Thread Ashley Sheridan
On Tue, 2009-02-24 at 08:51 -0500, Bob McConnell wrote: From: Jim Lucas I may be wrong, but I heard short tags were going the way of the Dodo bird as of PHP6. This is not surprising. With the advent of XHTML, the short tag option collides with another valid tag, ?xml. So that option

Re: [PHP] omg help...insane simple query won't work I must be blind

2009-02-24 Thread Daniel Brown
On Tue, Feb 24, 2009 at 14:55, Terion Miller webdev.ter...@gmail.com wrote: And yes yes I know escape my strings ...I'll go back and do that when the stupid insert is actually working... I'd suggest that it's probably the reason your insert isn't working. Add your

Re: [PHP] Re: how to deal with multiple authors for one book

2009-02-24 Thread Bastien Koert
On Tue, Feb 24, 2009 at 8:59 AM, PJ af.gour...@videotron.ca wrote: Reinhardt Christiansen wrote: From: PJ af.gour...@videotron.ca To: MySql my...@lists.mysql.com Subject: how to deal with multiple authors for one book Date: Mon, 16 Feb 2009 17:20:54 -0500 In my db there are a

Re: [PHP] help installing phpDocumentor

2009-02-24 Thread Lewis Wright
Forgot to click reply all! Sorry. -- Forwarded message -- From: Lewis Wright lewiswri...@gmail.com Date: 2009/2/24 Subject: Re: [PHP] help installing phpDocumentor To: a...@ashleysheridan.co.uk Turn on notices and maybe even strict messages (in your development environment), and

Re: [PHP] help installing phpDocumentor

2009-02-24 Thread Ashley Sheridan
On Tue, 2009-02-24 at 20:18 +, Lewis Wright wrote: Forgot to click reply all! Sorry. -- Forwarded message -- From: Lewis Wright lewiswri...@gmail.com Date: 2009/2/24 Subject: Re: [PHP] help installing phpDocumentor To: a...@ashleysheridan.co.uk Turn on notices and

Re: [PHP] help installing phpDocumentor

2009-02-24 Thread Lewis Wright
I'm sorry, Gmail makes me do it! 2009/2/24 Ashley Sheridan a...@ashleysheridan.co.uk: On Tue, 2009-02-24 at 20:18 +, Lewis Wright wrote: Forgot to click reply all! Sorry. -- Forwarded message -- From: Lewis Wright lewiswri...@gmail.com Date: 2009/2/24 Subject: Re: [PHP]

Re: [PHP] omg help...insane simple query won't work I must be blind (RESOLVED)

2009-02-24 Thread Terion Miller
Well I was going blind ready for a good laugh it was that the form was posting to the original page not the test page I was working with...um..DOH!! all things working now :) Thanks Terion Happy Freecycling Free the List !! www.freecycle.org Over Moderation of Freecycle List Prevents Post

RE: [PHP] help installing phpDocumentor

2009-02-24 Thread Bob McConnell
From: Lewis Wright Turn on notices and maybe even strict messages (in your development environment), and PHP should warn you of any deprecated code. Easier said than done. I don't have an IDE available. I have tried the Komodo editor and am now playing with Eclipse/PDT, but neither of those

Re: [PHP] help installing phpDocumentor

2009-02-24 Thread Lewis Wright
2009/2/24 Bob McConnell r...@cbord.com: From: Lewis Wright Turn on notices and maybe even strict messages (in your development environment), and PHP should warn you of any deprecated code. Easier said than done. I don't have an IDE available. I have tried the Komodo editor and am now

Re: [PHP] help installing phpDocumentor

2009-02-24 Thread Ashley Sheridan
On Tue, 2009-02-24 at 20:55 +, Lewis Wright wrote: 2009/2/24 Bob McConnell r...@cbord.com: From: Lewis Wright Turn on notices and maybe even strict messages (in your development environment), and PHP should warn you of any deprecated code. Easier said than done. I don't have an

[PHP] syntax

2009-02-24 Thread Terion Miller
Need syntax help when it comes to using a timestamp. What I'm trying to say in my query WHERE clause is to select records if the timestamp on the record is in the past 7 days from NOW() $query .= WHERE stamp NOW()-7 ; I have no clue here on this the lay language is WHERE stamp is within

Re: [PHP] syntax

2009-02-24 Thread Ashley Sheridan
On Tue, 2009-02-24 at 15:15 -0600, Terion Miller wrote: Need syntax help when it comes to using a timestamp. What I'm trying to say in my query WHERE clause is to select records if the timestamp on the record is in the past 7 days from NOW() $query .= WHERE stamp NOW()-7 ; I have no clue

Re: [PHP] syntax

2009-02-24 Thread Marc Steinert
Terion Miller wrote: $query .= WHERE stamp NOW()-7 ; I have no clue here on this Try $query .= WHERE stamp SUBDATE(NOW(), INTERVAL -7 DAY); instead. Marc -- http://bithub.net/ Synchronize and share your files over the web for free My Twitter feed

Re: [PHP] syntax

2009-02-24 Thread Marc Steinert
Marc Steinert wrote: Terion Miller wrote: $query .= WHERE stamp NOW()-7 ; I have no clue here on this Try $query .= WHERE stamp SUBDATE(NOW(), INTERVAL -7 DAY); instead. Marc Damn, hit the send-button too fast. Replace -7 with 7. Sry for spamming the list. --

Re: [PHP] PDO buffered query problem

2009-02-24 Thread Chris
Thodoris wrote: Stewart Duncan wrote: Hi there, I'm having some serious problems with the PHP Data Object functions. I'm trying to loop through a sizeable result set (~60k rows, ~1gig) using a buffered query to avoid fetching the whole set. No matter what I do, the script just hangs on

Re: [PHP] syntax

2009-02-24 Thread Chris
Terion Miller wrote: Need syntax help when it comes to using a timestamp. What I'm trying to say in my query WHERE clause is to select records if the timestamp on the record is in the past 7 days from NOW() $query .= WHERE stamp NOW()-7 ; I have no clue here on this the lay language is

Re: [PHP] syntax

2009-02-24 Thread Terion Miller
Has nothing at all to do with php. http://dev.mysql.com/doc/refman/5.0/en/datetime.html http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html Yeah guess I posted to the wrong list should of been on the php-db list maybe but thanks for the suggestions Marc I'll be trying yours

Re: [PHP] syntax

2009-02-24 Thread Martin Zvarík
Chris napsal(a): Terion Miller wrote: Need syntax help when it comes to using a timestamp. What I'm trying to say in my query WHERE clause is to select records if the timestamp on the record is in the past 7 days from NOW() $query .= WHERE stamp NOW()-7 ; I have no clue here on this

Re: [PHP] syntax

2009-02-24 Thread Jim Lucas
Terion Miller wrote: Need syntax help when it comes to using a timestamp. What I'm trying to say in my query WHERE clause is to select records if the timestamp on the record is in the past 7 days from NOW() $query .= WHERE stamp NOW()-7 ; I have no clue here on this the lay

Re: [PHP] syntax

2009-02-24 Thread Terion Miller
Nobody has asked to confirm, but what format is `stamp`? Unix Timestamp, MySQL Timestamp, MySQL Date stamp??? -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare

Re: [PHP] syntax

2009-02-24 Thread Micah Gersten
Martin Zvarík wrote: Chris napsal(a): Terion Miller wrote: Need syntax help when it comes to using a timestamp. What I'm trying to say in my query WHERE clause is to select records if the timestamp on the record is in the past 7 days from NOW() $query .= WHERE stamp NOW()-7 ; I have no

Re: [PHP] syntax

2009-02-24 Thread Martin Zvarík
Micah Gersten napsal(a): Martin Zvarík wrote: Chris napsal(a): Terion Miller wrote: Need syntax help when it comes to using a timestamp. What I'm trying to say in my query WHERE clause is to select records if the timestamp on the record is in the past 7 days from NOW() $query

Re: [PHP] syntax

2009-02-24 Thread Chris
Micah Gersten wrote: Martin Zvarík wrote: Chris napsal(a): Terion Miller wrote: Need syntax help when it comes to using a timestamp. What I'm trying to say in my query WHERE clause is to select records if the timestamp on the record is in the past 7 days from NOW() $query .= WHERE stamp

[PHP] Fwrite() vs file_put_contents()

2009-02-24 Thread Clancy
I have been pondering whether it would be feasible to work with a 100,000 entry index file, and had put yesterday aside to do some timing tests. I first generated some sample index files of various lengths. Each entry consisted of a single line with the form ASDF;rhubarb, rhubarb, where

Re: [PHP] syntax

2009-02-24 Thread Michael A. Peters
Micah Gersten wrote: $query .= WHERE stamp .(time()-7*3600*24); Using something like that is disastrous for DST and Leap Seconds... That's why you use UTC for servers and translate to local time when you need to display it. Not sure that solves the leap second issue, but it

Re: [PHP] Unexpected results using ksort on arrays in which the keys are mixed alphanumeric strings.

2009-02-24 Thread Clancy
On Tue, 24 Feb 2009 10:25:25 +0100, joc...@iamjochem.com (Jochem Maas) wrote: Clancy schreef: I have been experimenting using four character alphanumeric keys on an array, and when I generated a random set of keys, and then used ksort to sort the array, I was very surprised to find that if

Re: [PHP] optimizing space for array of booleans

2009-02-24 Thread leledumbo
Generally relationships like the one you describe are stored in three separate and related tables: Students, Courses, and Enrollment. The latter is a n:m association between the first two. The advantage this approach has with regard to storage is that it is a sparse matrix. I've done that

Re: [PHP] syntax

2009-02-24 Thread Jim Lucas
Terion Miller wrote: Nobody has asked to confirm, but what format is `stamp`? Unix Timestamp, MySQL Timestamp, MySQL Date stamp??? -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by

Re: [PHP] syntax

2009-02-24 Thread Jim Lucas
Jim Lucas wrote: Terion Miller wrote: Nobody has asked to confirm, but what format is `stamp`? Unix Timestamp, MySQL Timestamp, MySQL Date stamp??? -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II,

Re: [PHP] optimizing space for array of booleans

2009-02-24 Thread Andrew Ballard
On Wed, Feb 25, 2009 at 12:12 AM, leledumbo leledumbo_c...@yahoo.co.id wrote: Generally relationships like the one you describe are stored in three separate and related tables: Students, Courses, and Enrollment. The latter is a n:m association between the first two. The advantage this

Re: [PHP] optimizing space for array of booleans

2009-02-24 Thread leledumbo
Good points, I'll try it. Without testing it (it's late here), your binstr() function doesn't accept parameters, so it would always return the same result each time it's called, regardless of what you pass into it. In case you want to check it tomorrow or later: private function binstr() {

Re: [PHP] optimizing space for array of booleans

2009-02-24 Thread Chris
leledumbo wrote: Good points, I'll try it. Without testing it (it's late here), your binstr() function doesn't accept parameters, so it would always return the same result each time it's called, regardless of what you pass into it. In case you want to check it tomorrow or later: private

Re: [PHP] XML and :

2009-02-24 Thread Per Jessen
Merlin Morgenstern wrote: Hi there, I am trying to pars an XML file with php. This works if the xml tag looks like this: anbieternr88/anbieternr In that case I retrieve the info: $xml-anbieternr But now the tag looks different like this: imo:anbieternr88/imo:anbieternr The command