Re: [PHP] Newb question about getting keys/values from a single array element

2009-10-08 Thread Paul M Foster
#x27; => 'peach'); Then, out of all the POST members returned, I can pick out the ones pertaining to fruit by simply looking for ones which have the 'fruit_' prefix as their index. It tends to be clunky, but it's the only way I've found to make it work: $fruits = get_fruits_from_table(); foreach ($fruits as $key => $value) { $index = 'fruit_' . $key; if (isset($_POST[$index])) { echo "The user wants fruit #$key, $value."; } } Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Native support to MS SQL Server

2009-10-09 Thread Paul M Foster
virtues? Of course not. He actually meant PostgreSQL, which *does* have virtues. (No flames. I'm teasing.) Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP broadcast mailer

2009-10-17 Thread Paul M Foster
t; broadcast email script and willing to help me? > Use PHPList. It's free. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Spam opinions please

2009-10-20 Thread Paul M Foster
ughts on the script and its effectivness? > > $deny = array("111.111.111", "222.222.222", "333.333.333"); > if (in_array ($_SERVER['REMOTE_ADDR'], $deny)) { >header("location: http://www.google.com/";); >exit(); > } ?

Re: [PHP] php mail() function

2009-10-22 Thread Paul M Foster
erver over there will trust. The "bounce" message you got indicates that relaying from you is forbidden at the destination mail server. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] php mail() function

2009-10-22 Thread Paul M Foster
27;t know the mechanism by which they determine what is and isn't a dynamic IP.) Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] regex pattern for extracting URLs

2009-10-23 Thread Paul M Foster
On Fri, Oct 23, 2009 at 01:54:40PM -0400, Brad Fuller wrote: > Thanks Ash you are awesome! Brad, you're violating list rules. We never say that kind of thing to Ash *where he can hear it*. Only behind his back. ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.

Re: [PHP] php mail() function

2009-10-23 Thread Paul M Foster
ISP would accept it. It's just the From:. Again, I could be wrong. 5. This would be a lot simpler if you just call Shaw and ask them for the name of the mailserver, and ask them if it's a problem for you to post mail from your internal webserver to their mailserver. Then ask them why such posts might bounce with a 5XX error. Paul Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] What is the best practice for adding persistence to an MVC model?

2009-10-27 Thread Paul M Foster
y component which deals with the database class. The model serves up whatever data the controller needs to feed to the view. All are welcome to disagree. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] What is the best practice for adding persistence to an MVC model?

2009-10-27 Thread Paul M Foster
On Tue, Oct 27, 2009 at 04:11:32PM +, David Otton wrote: > 2009/10/27 Paul M Foster : > > > On Tue, Oct 27, 2009 at 05:27:07PM +1100, Eric Bauman wrote: > > >> I'm in the process of implementing an ultra-light MVC framework in PHP. > >> It seems to b

Re: [PHP] Re: Create a screenshot of a website

2009-10-28 Thread Paul M Foster
end of things to take care of, quite outside of redisigning phpclasses.net. I'd suggest you scrap the contest and go find a good free CSS template. But that's just me. And just for the record, I'm really not ragging on you. PHPClasses.net is the only site of its kind I know of. Th

Re: [PHP] Re: UrlRewrite htaccess confusion

2009-10-29 Thread Paul M Foster
nd define > it as a constant. It can be as simple or as complex as you need. > > Something > > -- or -- > > echo 'Something'; +1 I initialize a "links" class from the config, and then use it to serve up link text and URLs depending on the parameters

Re: [PHP] Convert deprecated POSIX functions into wrappers for equivalent PCRE functions

2009-11-08 Thread Paul M Foster
On Sun, Nov 08, 2009 at 06:30:37PM -0500, Robert Cummings wrote: > Also, why support > two libraries for which one is obviously inferior in speed and > functionality? > Because Tony's Radicore framework has a bunch of ereg* calls in it. ;-} Paul -- Paul M. Foster -- PHP Gen

Re: [PHP] Shoutbox suggestion needed

2009-11-16 Thread Paul M Foster
rned on. However, Java is another story. You may find that many more have it turned off. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Noob question: Making search results clickable.

2009-11-18 Thread Paul M Foster
itle]"; Then ensure that video_display.php is set up to fetch the video whose ID is passed to it via the GET parameter. All this assumes I understood what you're getting at. Which is questionable. ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Noob question: Making search results clickable.

2009-11-19 Thread Paul M Foster
On Thu, Nov 19, 2009 at 03:53:55PM +0100, Nisse Engström wrote: > On Wed, 18 Nov 2009 10:31:59 -0500, Paul M Foster wrote: > > > Replace your query with: > > > > "SELECT title, id FROM videos WHERE topid1 = '$topic'" > > > > or whatever ind

Re: [PHP] Noob question: Making search results clickable.

2009-11-19 Thread Paul M Foster
On Thu, Nov 19, 2009 at 03:07:42PM +, Ashley Sheridan wrote: > On Thu, 2009-11-19 at 10:09 -0500, Paul M Foster wrote: > > > Ahem. You are correct. I should have escaped the double quotes. I've > *never* made this kind of mistake before. ;-} > > Pau

Re: [PHP] dynamic meta tag and title app?

2009-11-19 Thread Paul M Foster
ame is tedd and not todd. :-) I think the real question is what did you do with todd? Are those his feet sticking out from behind that cabinet over there? Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] dbase_get_record_with_names; Very slow search!!!

2009-11-24 Thread Paul M Foster
exes. Moreover, without selecting the specific index tag, your search won't go any faster as a result of the index. I suspect the bottleneck is in the way the drivers access the file. xBase is a fixed length record format with a variable length header, so it's pretty simple and fast to pu

Re: [PHP] processing html forms and keeping the values

2009-11-24 Thread Paul M Foster
se { show_the_file_for_the_first_time(); } In the do_validation() step, you validate the form. If there is a problem and you want to re-show the form, you would typically do this for each field: In other words, you store the form values in the $_SESSION array. Paul -- Paul M. Foster

Re: [PHP] dbase_get_record_with_names; Very slow search!!!

2009-11-24 Thread Paul M Foster
hat's part of what I use it for. (No, I don't make any money off the program. I wrote it for my own use and put it up on sourceforge years ago in case someone could use it.) Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] cookies and carts

2009-12-07 Thread Paul M Foster
? Intead of > $_COOKIE['item_number'] have $_COOKIE['cart']['item_number'] like I have the > SESSION? First, don't use multiple cookies; already covered elsewhere. Second, you can serialize/unserialize array data and store it compactly in a cookie. See

Re: [PHP] can't retrieve more than 1 record at the time

2009-12-09 Thread Paul M Foster
$stmt = NULL; /* release the connection */ > > /*if not done with stack, redirect to self to get next*/ >if (!empty($_SESSION['DOCIDs']) and >$_SESSION['numberCand'] < count($_SESSION['DOCIDs'])) >{ >exit; > >} >} > } > > /* once done, go back to display search page after clearing stack > if(isset($_SESSION['DOCIDs'])) >unset($_SESSION['DOCIDs'] );*/ > > $res = null; > $dbh1 = null; Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] I have not seen any messages for a couple of days...

2009-12-10 Thread Paul M Foster
> no, your confused with that other list php-psychics. :-) (STA) I thought that list was swallowed by a .Net black hole? ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MySQL Appeal from Monty

2009-12-15 Thread Paul M Foster
nst > mishaps and MySQL is known more for performance. PostgreSQL generally matches MySQL in performance, and maintains referential integrity (foreign keys and such) without the need for multiple backend storage engines. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.

Re: [PHP] TCPDF line breaks

2009-12-22 Thread Paul M Foster
df->MultiCell() to accomplish this, rather simply $pdf->Write() (it's kinda like a textarea in HTML). There's probably something comparable in TCPDF. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] If design patterns are not supposed to produce reusable code then why use them?

2009-12-30 Thread Paul M Foster
such a way that there's just no way to adapt it to different circumstances. But for the most part, it's like any other code you expect to reuse, whether it's just a function, a plain class or whatever. If you implement it properly, it will be reusable elsewhere. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] POLL: To add the final ?> or not...

2010-01-10 Thread Paul M Foster
On Sun, Jan 10, 2010 at 06:41:19AM -0800, Michael A. Peters wrote: > Daevid Vincent wrote: > >> >> What do you guys all do? > I leave it off. I don't want to have to worry about which editor I'm using or whether I accidentally left some whitespace where it shouldn&

Re: [PHP] Form validation and save the form

2010-01-10 Thread Paul M Foster
time through, the value attribute will yield nothing. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Formatting Decimals

2010-01-11 Thread Paul M Foster
ns, at: http://us2.php.net/manual/en/book.bc.php Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Formatting Decimals

2010-01-11 Thread Paul M Foster
nt and can only be seen after tens > of thousands iterations. PHP's rounding function is quite sufficient. This is called (among other things) "banker's rounding". But PHP's round() function won't do banker's rounding, as far as I know. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] corect way to use mail() function

2010-01-11 Thread Paul M Foster
> Am I right or it really doesn't matter "who" sent the email? Since the mail() function doesn't have a parameter for the "From:", how do you force it to be a certain thing in the first place? Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread Paul M Foster
many spins > > occur over the throw distance. > > > > Cheers, > > Rob. > > -- > > http://www.interjinn.com > > Application and Templating Framework for PHP > > > > > There's always a chance that if thrown, the egg won't contact end-on. > Has anyone thought to factor this in? Is that an African or European egg? Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread Paul M Foster
On Tue, Jan 12, 2010 at 06:08:59PM +, Ashley Sheridan wrote: > On Tue, 2010-01-12 at 13:10 -0500, Paul M Foster wrote: > > On Tue, Jan 12, 2010 at 05:24:06PM +, Ashley Sheridan wrote: > > > > > > > There's always a chance that if t

Re: [PHP] header("Location:...") fails

2010-01-13 Thread Paul M Foster
o do so.) > > Obviously, I'm missing something incredibly basic. Can anyone help me figure > this out? For one thing, I'd put a space after "Location:" in the header() call. But I've found that this call will sometimes fail (or *look* like it fails) unless yo

Re: [PHP] php and XML BibTeX

2010-01-13 Thread Paul M Foster
o from that to "real" bibTex, which I > may need to do at some point. > > What I'm hoping is that already exists some php classes / functions for > dealing with the XML bibTeX but I haven't found them. Anyone know of any? I don't know, but the first place I look

Re: [PHP] Object Oriented Programming question

2010-01-19 Thread Paul M Foster
ms kind of silly when you could just as easily write external functions which perform similar functions. Bottom line is, study OOP (look it up in wikipedia.org), and if you think its advantages are worth your effort to learn the new paradigm, go with it. But ignore the hype (and there's a lot of it

Re: [PHP] Cookies & sessions

2010-01-19 Thread Paul M Foster
es > this place any limitations on using both sessions and cookies in the > same program? I don't believe so. If I'm not mistaken, session values are stored on the server, not on the client. What's stored on the client is the session ID. Please bear in mind my understanding

Re: [PHP] Object Oriented Programming question

2010-01-19 Thread Paul M Foster
On Tue, Jan 19, 2010 at 05:44:56PM +, Ashley Sheridan wrote: > > Oh, and your flame suit failed because you forgot the quotation marks around > the attribute values, and you didn't close the tag :p Dang! I *thought* it felt awfully warm in here. Paul -- Paul M. Foster -

Re: [PHP] Object Oriented Programming question

2010-01-19 Thread Paul M Foster
ndency injection transparently. Again, a complex proposition. > Another advantage of OOP that is difficult to > provide via the procedural paradigm is polymorphism. Agreed. Though the advantages of polymorphism are questionable, depending on your viewpoint. Paul -- Paul M. Foster

Re: [PHP] Object Oriented Programming question

2010-01-20 Thread Paul M Foster
a little crippled by comparison. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Object Oriented Programming question

2010-01-20 Thread Paul M Foster
e to build OO components which were usable in this context, I'd be happy to use them. OTOH, MVC (OOP on steroids) is just beyond reasonable in most cases for client sites. I will also echo that it takes a lot of time/work to correctly build OO components, compared to straight functions or fu

Re: [PHP] Open Source CMS

2010-01-20 Thread Paul M Foster
, some from the > lists: > - Drupal > - Tomato CMS > - modx > - xoops > - Symphony Add CodeIgniter to your list. Relatively easy to understand and extend. Though I'm not sure I'd classify it as a "content management system". (Same for Symfony.) Paul

Re: [PHP] Open Source CMS

2010-01-20 Thread Paul M Foster
"designers" who don't know HTML but do the work of designing pages. This is just simple advice based on my experience. Feel free to ignore it completely if you work better a different way. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] If the first four characters are "0000", then do {}

2010-01-25 Thread Paul M Foster
> > What I am looking for is in strpos(), no? > > if () > { > } >From what I understand, strpos() faster than a lot of other similar string functions and much faster than regexps. You could do: if (strpos($mydata->restored, '') === 0) { do_

Re: [PHP] In need of better __FILE__, __LINE__ and __FUNCTION__ magic variables

2010-01-25 Thread Paul M Foster
item that corresponds to the location where print_debug() > was called. +1 Or you can use debug_print_backtrace(), which directly outputs the backtrace. I do this when my error handler encounters E_USER_ERROR and the like. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-25 Thread Paul M Foster
the local mailserver deal with transferring mails in its own sweet time. I don't know if there's a mailserver included in XAMPP installations, but if so, I'd do that. In fact, if you're just sending simple emails, you could use PHP's built-in mail() function, which wil

Re: [PHP] SQL question

2010-01-25 Thread Paul M Foster
g one yourself, save yourself some time and convert all dates to Julian day numbers internally. This saves massive amounts of computation in determining intervals and durations. Typically, coders try to store dates in unix timestamps internally, and then add 86400 seconds for every day to calculate int

Re: [PHP] If the first four characters are "0000", then do {}

2010-01-25 Thread Paul M Foster
On Mon, Jan 25, 2010 at 08:12:43PM -0800, Daevid Vincent wrote: > > -Original Message- > > From: Paul M Foster [mailto:pa...@quillandmouse.com] > > Sent: Monday, January 25, 2010 8:05 PM > > To: php-general@lists.php.net > > Subject: Re: [PHP] If the first fo

Re: [PHP] DirectoryIterator

2010-01-26 Thread Paul M Foster
nd is available on the host system. Check first to make sure. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-26 Thread Paul M Foster
eover, most (all?) Linux MTAs on boxes like this don't block while they make connections. From the OP's description, it sounded like his phpmailer() process was blocking while it made foreign connections. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Do you use a public framework or roll your own?

2010-01-26 Thread Paul M Foster
;m in the majority (almost 2:1) who close their > opening PHP tags. :) Gosh, I can't believe so many people could be so *wrong*. ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Do you use a public framework or roll your own?

2010-01-26 Thread Paul M Foster
For example, I won't use screwdrivers whose handles aren't covered with rubber over the plastic of the handles (Stanley and Klein brands). What I like about programming is that you get to build your own tools, just the way you like them. ;-} Paul -- Paul M. Foster -- PHP General Mai

[PHP] Magic Methods not working

2010-01-26 Thread Paul M Foster
end of the routine. That statement doesn't fire with the above code. The docs on magic methods are pretty slim, so I'm not sure what it is I'm missing. Can someone enlighten me? Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Magic Methods not working

2010-01-26 Thread Paul M Foster
On Wed, Jan 27, 2010 at 11:19:34AM +0800, Eric Lee wrote: > > > On Wed, Jan 27, 2010 at 11:04 AM, Paul M Foster > wrote: > > I have a class which instantiates other classes, and has a magic method > like this: > > function _get($classname) >

Re: [PHP] Reliable way to identify Ogg types?

2010-01-26 Thread Paul M Foster
the data from /usr/share/file/magic, which has a more thoroughgoing understanding of ogg files. Unless someone's built a class which does this for you. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Magic Methods not working

2010-01-26 Thread Paul M Foster
On Tue, Jan 26, 2010 at 07:21:34PM -0800, Daevid Vincent wrote: > > -Original Message- > > From: Paul M Foster [mailto:pa...@quillandmouse.com] > > Sent: Tuesday, January 26, 2010 7:05 PM > > To: php-general@lists.php.net > > Subject: [PHP] Magic Methods not

[PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Paul M Foster
t's called, which usually isn't necessary and adds time. Instead, work out the number of items before going into the loop and simply refer to that for the number of items in controlling the loop. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Replacing accented characters?

2010-01-27 Thread Paul M Foster
d an "umlaut". Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Reports generator

2010-01-27 Thread Paul M Foster
re I tackle a full-on "pretty" OO solution. (The other reason I'd do it this way is that I used to work for a company that sold a report-writer coded in C. I never realized the complexities of reports until I'd worked with that product for a while. Subtotal levels, grand total levels, headers, footers, column labels, gathered from a variety of COBOL, C, BASIC and other databases. Ugh.) Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-28 Thread Paul M Foster
uotes will not be evaluated, whereas those within double quotes will be. What these tips are about is coding things using best practices, derived from logical examination of the way PHP is advertised to function, not transitory benchmarks. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Reports generator

2010-01-28 Thread Paul M Foster
ious email, I wouldn't store the results of a query in a database. If you find you simply must save the results, just jam the whole HTML page into a string and store that (unless I'm misunderstanding what you're doing). Otherwise, just generate the report in real time. Paul -- Paul M.

Re: [PHP] Reports generator

2010-01-28 Thread Paul M Foster
On Thu, Jan 28, 2010 at 10:49:17AM -0500, Robert Cummings wrote: > Paul M Foster wrote: >> On Thu, Jan 28, 2010 at 01:31:30AM -0800, Allen McCabe wrote: >> >> >> >>> SIDE QUESTION: What do you think of my use of serialization? I don't see a >>>

Re: [PHP] Replacing accented characters?

2010-01-28 Thread Paul M Foster
I just got this image of all of us at a table at the local Chili's twirling around in place like dogs, trying to find our asses. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Creating an Entire .html page with PHP

2010-01-28 Thread Paul M Foster
ite an opening tag, i immediately write the closing tag > >next, then cursor back to fill it in. > > Not so easy when you are using PHP to generate a complex layout! Use heredocs to do it. Then you can generate the layout in PHP and still do what deal...@gmail.com said. Paul -- Paul M

Re: [PHP] database abstraction layer

2010-02-02 Thread Paul M Foster
class around the PDO classes, which will take care of quoting, etc. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] database abstraction layer

2010-02-02 Thread Paul M Foster
pinion is that a programmer should learn the SQL dialect he's working with and use it, rather than something like Active Record. Internally we use PostgreSQL exclusively. The only time I use MySQL is for customer sites where their hosting companies don't support PostgreSQL. In that case, I simply write SQL targetted at MySQL's dialect. It all goes through the same database class to perform error checking and results return. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] database abstraction layer

2010-02-02 Thread Paul M Foster
;) For MySQL I would agree. But I prefer the ability to use the full SQL standard when manipulating a database; that is, all joins, foreign keys, etc. For that same reason, I tend to avoid stored procedures as well. If I have to do things like handle foreign key constraints in my PHP code (ins

Re: [PHP] database abstraction layer

2010-02-02 Thread Paul M Foster
(all with an insert for stats purposes) > for a few weeks handles the getMax issue, and i see i did use mysql's > auto_increment there. > > i suppose the difference in syntax between sql servers for this one is > acceptable. Am I the only one who's seeing Rene's repl

Re: [PHP] PHP User

2010-02-03 Thread Paul M Foster
dations. Programming PHP by Lerdorf, Tatroe, MacIntyre (O'Reilly) http://php.net/manual/en/ For object oriented PHP code, PHP In Action: Objects, Design, Agility by Reiersol, Baker, Shiflett (Manning) Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] php selecting multiple stylesheets

2010-02-07 Thread Paul M Foster
able to do something like this (I'm using SESSION variables because cookies are more complicated): ... ... Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: poll: howto do informative error handling without the fatalities

2010-02-09 Thread Paul M Foster
ng like this is if I were using native PHP functions and the possible failure of the functions wouldn't matter. Rather, I'd do something like this: $d = funcD($q); // tests if necessary $c = funcC($p); // tests if necessary $b = funcB($c); // tests if necessary $r = funcA($b, $d);

Re: [PHP] PHP Manual problems

2010-02-10 Thread Paul M Foster
6 for Google Apps. You may not use Google Apps (I don't), but as Google goes, so will go the internet, eventually. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Persistent flag in memory

2010-02-10 Thread Paul M Foster
r file. As for apache, I suspect you're stuck with calculating intervals to determine the flag, as described above. Maybe someone else has a better idea. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread Paul M Foster
in the context of a field name should instead be interpreted as a function call. Buy maybe that's just me. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Manual problems

2010-02-11 Thread Paul M Foster
ould we care about other players in the market? Just buy our crap and you won't have to worry about our formats." (Except until the next upgrade.) I think ISO's policy should be that if you're a company forwarding a standard, your off-the-shelf software should verifiably duplicate that standard. Otherwise, go pound sand. Same if you're a community proposing a standard. Produce some software which adheres to that standard or shut up. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread Paul M Foster
and must accommodate some seriously obfuscated code. Which it does reliably. Besides, if you've got a parser which understands joins, parsing things like the distinction between hour (field name) and hour (function call) is a piece of cake. If a programmer working for me tried to pawn this o

Re: [PHP] Re: UK Project Opportunity

2010-02-16 Thread Paul M Foster
gistration to download anything. I imagine that the registration allows Manuel to tightly monitor site usage in a variety of ways. But I don't know of another, better, resource for PHP code written by random developers anywhere. I'm willing to give his site a plug when someone can't find a

Re: [PHP] Re: UK Project Opportunity

2010-02-16 Thread Paul M Foster
ent, but I'm too busy writing code to worry about that much. I will say this though: if you're on a list like this and someone materially assists you with their advice, it would be a nice courtesy to just write back and thank them. It also helps let others know that this particular piec

Re: [PHP] Re: UK Project Opportunity

2010-02-16 Thread Paul M Foster
www.phpclasses.org/design/turn/2/theme/igd01.html > > If you cannot see it yet, the author left a preview on their site: > > http://www.intergraphicdesigns.com/clients/phpclasses/ Muuuuch better. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscr

Re: [PHP] Re: UK Project Opportunity

2010-02-16 Thread Paul M Foster
fight with you later about the code. And if I submit a patch to your project, you're free to do as you like with the code and its copyright. By the way, I am *not* saying Manuel does this. I'm just commenting on Rene's post. Paul -- Paul M. Foster -- PHP General Mailing List (h

Re: [PHP] Re: UK Project Opportunity

2010-02-16 Thread Paul M Foster
've ever seen, besides insisting on a registration/login, has ever been satisfactory. The above is a real-world example of this in action. And as Manuel details, it has some definite benefits to users and developers. Again, having to register/login is a pain. But ads are a pain, too. It&#x

Re: [PHP] Re: UK Project Opportunity

2010-02-16 Thread Paul M Foster
he same between the two licenses, but Linus has some issues with some of the provisions of GPLv3. Other projects have wanted to change licenses for whatever reason, but where the copyrights are owned by a variety of people, getting them all to agree on the change has been a problem. Paul -- Paul

Re: [PHP] Export/Write rows from DBF to CSV

2010-02-18 Thread Paul M Foster
gt; > I'm trying to adopt this piece of code for my use. I fixed the csv_data .= > trim error. Does anyone know how I can fix empty fields? Everything is > dumping to a csv file but information is not matching up. I don't know if I > can insert a space or something if field

Re: [PHP] array conversion

2010-02-18 Thread Paul M Foster
0; $i < $numitems; $i++) { if ($i % 2 == 0) { $saved_key = $a[$i]; } elseif ($i % 2 == 1) { $b[$saved_key] = $a[$i]; } } Code is crude and untested, but you get the idea. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Using base64 encode and decode to store user data in database

2010-02-19 Thread Paul M Foster
Paypal $20 to Chris > himself if that remains my only option! Chris, what say you? (CCed) Wow, that sucks! This is an O'Reilly book. Perhaps they would ship to Israel? Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Sending e-mail via socket

2010-02-22 Thread Paul M Foster
t operation as though it's a static one-sided conversation. I'm not an expert, but SMTP conversations don't normally work this way. You issue the HELO, wait for the response, issue other commands, wait for the response, etc. The way you're doing it, if your SMTP conversation runs into any snags (like the RCPT TO is not recognized), you won't know it. Your function will simply ride over the error, because it's not listening to the SMTP server. Again, I'm not an expert, so maybe there's something I've overlooked. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PDOStatement::rowCount() bug?

2010-02-22 Thread Paul M Foster
Using MySQL 5.075, PHP 5.25 on Debian unstable. Has anyone noticed, when issuing a PDOStatement::rowCount() call after a DELETE, UPDATE or INSERT, the return is uniformly zero, rather than the actual number of rows affected? If so, is there a simple workaround? Paul -- Paul M. Foster -- PHP

Re: [PHP] PDOStatement::rowCount() bug?

2010-02-22 Thread Paul M Foster
On Mon, Feb 22, 2010 at 08:18:25PM -0700, Nathan Nobbe wrote: > On Mon, Feb 22, 2010 at 7:50 PM, Paul M Foster > wrote: > > Using MySQL 5.075, PHP 5.25 on Debian unstable. > > Has anyone noticed, when issuing a PDOStatement::rowCount() call after a > DELETE,

Re: [PHP] PDOStatement::rowCount() bug?

2010-02-22 Thread Paul M Foster
On Mon, Feb 22, 2010 at 09:50:30PM -0500, Paul M Foster wrote: > Using MySQL 5.075, PHP 5.25 on Debian unstable. > > Has anyone noticed, when issuing a PDOStatement::rowCount() call after a > DELETE, UPDATE or INSERT, the return is uniformly zero, rather than the > actual number o

Re: [PHP] PHP / mySQL Project... Real men use 'cat'

2010-02-23 Thread Paul M Foster
to JOE. Pffft. Real men use Vim. And Emacs is for Martians with ten fingers on each hand. And yeah, for what it's worth, I've been running Linux since 1996. And yeah, cats are smarter than dogs. Flame on! ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] PHP Syntax Help - Check?

2010-02-24 Thread Paul M Foster
'element8'); >> >> In the above line, can someone tell me what "check" means? > > > In the above, check is a function. It is being called with parameter > 'element8'. This is true. But perhaps more importantly, check() is not a native PHP fu

Re: [PHP] Database design

2010-02-24 Thread Paul M Foster
ate PDO classes only complicates the interface to the library. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Best Practices Book, Document, Web Site?

2010-03-02 Thread Paul M Foster
what we got was arguments from people who took exception one way or another. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] php string syntax question with html

2010-03-10 Thread Paul M Foster
method()}"; Um, not exactly. "This will parse correctly: $_SERVER[DOCUMENT_ROOT]." You just can't use single quotes inside the brackets to denote the array index, when the whole string is surrounded by double quotes. A more pedestrian example: $message = "The value of foo i

Re: [PHP] I need a fresh look at storing variables in MySQL

2010-03-13 Thread Paul M Foster
r(10) You can easily subset by voter, or by question ID. Or analyze answers in relation to other answers, etc. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] I need a fresh look at storing variables in MySQL

2010-03-13 Thread Paul M Foster
on this list for a long time, and his skills are plenty adequate for this task. He's just asking for second opinions. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Event Handling

2010-03-15 Thread Paul M Foster
seem sensible? Or overkill? > > Thanks again for your help in this, it's quite novel for me. I would think that the PHP CLI extension would need to be installed on the server for this to work. I don't know that that's common. (I could be completely wrong.) I would recommend

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Paul M Foster
ssy. So I finally wrote a C utility which parses the file and yields tab-delimited records without the quotes. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Paul M Foster
width of all the fields in a file. And a simple explode() call allows pulling all the fields into an array, based on a common delimiter. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

<    1   2   3   4   5   6   7   8   >