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: 88 > In that case I retrieve the info: $xml->anbieternr > > But now the tag looks different like this: > 88 > > The command $xml->imo:anbieternr does not work in that

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 func

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 Andrew Ballard
On Wed, Feb 25, 2009 at 12:12 AM, leledumbo 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 >> approach has with regard

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

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

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 certa

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

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

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

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 Willi

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 l

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

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

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 th

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. -- http://bi

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 http://twitter.com/MarcS

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 n

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

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 : > > 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 I

Re: [PHP] help installing phpDocumentor

2009-02-24 Thread Lewis Wright
2009/2/24 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 wit

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

Re: [PHP] help installing phpDocumentor

2009-02-24 Thread Lewis Wright
I'm sorry, Gmail makes me do it! 2009/2/24 Ashley Sheridan : > On Tue, 2009-02-24 at 20:18 +, Lewis Wright wrote: >> Forgot to click reply all! Sorry. >> >> -- Forwarded message -- >> From: Lewis Wright >> Date: 2009/2/24 >> Subject: Re: [PHP] help installing phpDocumentor >>

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 > Date: 2009/2/24 > Subject: Re: [PHP] help installing phpDocumentor > To: a...@ashleysheridan.co.uk > > > Turn on notices and maybe even s

Re: [PHP] help installing phpDocumentor

2009-02-24 Thread Lewis Wright
Forgot to click reply all! Sorry. -- Forwarded message -- From: Lewis Wright 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 PHP should warn you o

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 wrote: > Reinhardt Christiansen wrote: > > > > > > > >> From: PJ > >> To: MySql > >> 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

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 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 mysql_real_escape_string() stuff there, and t

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, " turned off

[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 Add New Ad"; } else { ?> And yes yes I know escape my str

Re: [PHP] XML and :

2009-02-24 Thread mike
On Tue, Feb 24, 2009 at 6:51 AM, Merlin Morgenstern 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. it's an ugly hac

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 ope

[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 Language, Proof and Logic Jon Barwise, John Etchemendy, Center for the Study of Language and Inf Amazon.com -- Nonfiction -- Philosophy -- Logic & Language

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 ht

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

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

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

Re: [PHP] XML and :

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

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 c

[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: 88 In that case I retrieve the info: $xml->anbieternr But now the tag looks different like this: 88 The command $xml->imo:anbieternr does not work in that case. Has somebody an idea how to adress

Re: [PHP] optimizing space for array of booleans

2009-02-24 Thread Andrew Ballard
On Tue, Feb 24, 2009 at 3:24 AM, leledumbo 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 * 2458 > (assuming one

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

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

2009-02-24 Thread PJ
Reinhardt Christiansen wrote: > > > >> From: PJ >> To: MySql >> 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 on books and authors to be

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, "http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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

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 b