Re: [PHP] Recommendation for a MySql wrapper class
On Sat, Apr 02, 2005 at 01:08:30PM +0200, Marek Kilimajer wrote.. If anybody (with more experience) than I thinks I am wrong...please tell me so and most prolly go with PEARs solution, another one high on my list is the ADODB as I remember someone else talking about it on the list some time back. You can pack PEAR classes with your project and set up include_path accordingly. Like Ryan (original post), I too am about to embark on a new website project and have the opportunity to do it differently. In the past I did the basic php/mysql connects, etc. But since reading this post, have looked into adodb and pear. Pear looks very interesting and I've given it a go. I like the looks of DB_Table, and how it integrates with HTML_QuickForm. I also like how pear has the commandline interface to search, install and update. But this makes me wonder ... are newer releases of classes always compatible with pages/scripts that I might have written earlier? If I update a class package, might it break my existing pages? And finally, does the pear project have enough momentum, and contributors, such that I can feel comfortable that it will be around for a while? I guess I'm asking these questions because the whole pear package repository seems very dynamic (in a good way). I'm just wondering if it does make sense to 'pack' up the pear classes, with versions related to my webpages, rather than assume the classes that get updated will always work with my stuff. Kind of a long winded question. Apologies. Kevin -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] create multiple jpg thumbnails and use in a page
Is there a way to create multiple jpg thumbnails from a series of larger originals and use all of the on-the-fly generated thumbnails in a page (without saving any of the thumbnails to the filesystem)? For example, I've got 5 full size jpg's in a directory, and I'd like to list them on a page in table form as follows image1.jpg thumnbnail imageimage1 size datestamp image2.jpg thumnbnail imageimage2 size datestamp image3.jpg thumnbnail imageimage3 size datestamp image4.jpg thumnbnail imageimage4 size datestamp image5.jpg thumnbnail imageimage5 size datestamp From php.net, I've found plenty of examples of how to create thumbnails from files and have done a couple successfully. My objective, however, is to have a page dynamically create multiple thumbnails from full sized images. I don't want to be creating and saving thumbnails to be used later. Possible? If so, then please just a pointer in the right direction. Thanks, Kevin -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sort multidim array
I've been banging my head against the wall on this one. Probably trivial to the knowledgeable, but I'm stumped despite trying the various sort functions as advertised on php.net. I've got the following fields: retailer city state telephone distance Sample data looks like: BLIND BROOK CLUB PURCHASE, NY (914) 939-1450 4.6 BURNING TREE CCGREENWICH, CT (203) 869-9010 0 CENTURY COUNTRY CLUB PURCHASE, NY (914) 761-0400 4.6 FAIRVIEW CC GREENWICH, CT (203) 531-4283 2.2 .. All of this is in an array I'll call $zipArray. When I get the data from mysql, it doesn't contain the 'distance' info. The distance field is calculated and tacked onto each row by having everything go through a foreach loop. So I start with an array that has 4 data columns (retailer, city, state and telephone) and I end up with an array that has 5 data columns (retailer, city, state, telephone, and distance). If I apply asort($zipArray) it sorts nicely on the first data column - retailer. But I need it to sort on the last data column - distance. I think I've been staring at this too long. Would appreciate any guidance. Thanks Kevin -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] register globals changed to off, script breaks
I had a couple pages that had used a few 'a href' links to create a URL like this: http://mydomain.com/profile.php?cid=6 When you clicked the link, it went to the profile.php page, which had the following code snippet: foreach($_GET as $varname = $value) $formVars[$varname] = trim($value); This worked great when the server had 'register globals' set to on. However, desiring to tighten up the security of the server a bit, I turned register globals to off. Now the above code snippet doesn't work. I've done quite a bit of searching and reading and haven't yet come up with a similar substitute (and I'm still learning PHP) for creating the variable array from the GET. What does work is: $cid = $_GET($varname); But that is only for when a single variable is passed, not when a bunch of them get passed and need to be put into an array. Would appreciate any tips. Thanks Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] performance hit using imagecreatetruecolor
I'm working on a website where I'd like to display a thumbnail from a repository of jpg's of normal (@ 800x600 px) size. Each time a user comes to this page, I'd like to show a new thumbnail from a different image in the repository. Obviously I could simple resize all the jpg's to my desired size and stick them in a thumbnail-repository and randomly call them up. I'm o.k. with this approach and will probably do it. But I've also played around with imagejpeg and imagecreatetruecolor, and have put together a small function that takes a jpg from the repository, sizes it to thumbnail, and then displays it in the browser. This is real slick and a nice solution, but is there a performance hit there that might slow down page loads for viewers? I know it's all server-side, but my impression is that resizing pics is generally CPU intensive and takes a second or two. Would appreciate any insights. Thanks Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] download filesize problem with IE
Not sure if this is just a problem with MS IE, or if there's something I need to set in my php.ini. I've got some large zip files sitting in a directory in my website for my clients to download (no these aren't programs for warez but images for the graphics industry). One of the zip files is 78 MB. When using MS IE6 and when I right click the link for that zip file to download it (then 'File Save As), IE gives back an error message that IE cannot download ... path/filename from website.net and IE was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later. However, if I try the same thing with a much smaller zip file, it works in IE. And of course, if I use any other browser but IE, then it works perfect no matter what the file size. So it seems to be a combination of MS IE and large file size. In my php.ini, I've got: post_max_size = 100M upload_max_filesize = 100M Is there anything else I need to do in php.ini? Mime settings or execution times? Or is this just another shortcoming in IE? And if so, is it editable? Many thanks Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php