homepage Welcome to WebmasterWorld Guest from 54.204.215.209
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Bag-O-Tricks for PHP III
Couldn't find "part III" in the php library section
neophyte




msg:1256074
 2:41 pm on May 17, 2005 (gmt 0)

has Bag-O-Tricks for PHP II been named something else? I located, the first, second, and fourth sections, but couldn't located the third.

These bag-o-tricks threads have been a real resource to me - as I'm sure they are to others.

Neophyte

 

MrMacphisto




msg:1256075
 2:44 pm on May 17, 2005 (gmt 0)

II: [webmasterworld.com...]
III: [webmasterworld.com...]

jatar_k




msg:1256076
 4:03 pm on May 17, 2005 (gmt 0)

and 4
[webmasterworld.com...]

neophyte




msg:1256077
 1:12 am on May 18, 2005 (gmt 0)

Cool. Thanks!

Stormfx




msg:1256078
 6:15 am on May 18, 2005 (gmt 0)

Well, all the topics were closed, but I wanted to make a comment. Guess I'll post it here! :)

In the first one, someone mentioned something about variable functions and their usefulness. I didn't feel like sorting through all the other posts to see what people had posted, but I have a really good use for them. A dynamic database class. Say your database class may need to connect to either a MSSQL server or a MySQL server. And, it's possible the server might be running PHP 5, so then you may need to utilize the MySQLi functions, instead. Simple enough, most of those three classes of functions are identical, with a few exceptions, of course. But, here's the example:

class database {
// yada yada
public $type = 'mysqli'; // default type

// more stuff

// example function
public query($sql, $link) {
$query = $this->type.'_query';
return $query($sql, $link);
}
}

Note that this is just an example. I have a single class that I use reguardless of the server type :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved