This is why PHP rocks
by pompo500 on Aug.19, 2010, under Software
PHP lets you concentrate on the most important part of software development: the problem itself. If you manage to put together hig-level APIs that do most of the work for you, then it’s easy as this.
The previous function GetMatchDuration() would be implemented without this library somewhat like this:
$SQL = ‘SELECT MINUTE(MatchEnds – MatchStarts) FROM matches WHERE MatchID = ‘.mysql_escape_string($MatchID);
if(!($Query = mysql_query($SQL)))
return false;
if(!($Row = mysql_fetch_row($Query)))
return false;
return $Row[0];
Quite a lot prettier in the picture, huh?
PHP effin’ rocks.