Getting a random roll of the dice:
CREATE TABLE dice ( d\_id int(11) NOT NULL auto\_increment, roll int, PRIMARY KEY (d\_id) ); insert into dice (roll) values (1); insert into dice (roll) values (2); insert into dice (roll) values (3); insert into dice (roll) values (4); insert into dice (roll) values (5); insert into dice (roll) values (6); select roll from dice order by rand() limit 1;
We are a fairly large PHP shop at work running some of the largest Danish websites. In a fairly new project, it was suggested that we considered using the Zend Framework to fast track development and piggy back upon some of the components provided by the framework. We looked at it, and said no – at least for now. Since the Zend Framework website does an excellent sales pitch on why you should use it, here’s some of the arguments why you should restrain from using the framework.
Suppose you want to write a system, which requires a password to do something. Not a login system, but just a shared secret. Suppose also, that you need to show someone the source code, but you don’t want him or her, the secret password can you do that. Sure. Here’s a simple way to do it with PHP.
So I may be slightly atypical. 18 months ago I decided to drop Windows. For a while I’ve been running OSX at home, but since it required new hardware at work, it wasn’t an option there. So I switched to Fedora (our Linux God at work was runing it, and it always nice with an expert around to save the day :-) ). Friday however I switch to KUbuntu and unassisted.
I’ve been playing with XML-RPC – a remote procedure calling using HTTP as the transport and XML. If you’re interested in how to use XML-RPC in PHP, go to the lab page on XML-RPC with PHP.