CSI: PHP

"Looking at your tweets I cannot even fathom what your job is. CSI:PHP?" — @grmpyprogrammer

Query Builder

| Comments

This is so bad ass. I’m going to start using it in all my projects. Wait, it’s already in all my projects. FML.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
Function BuildQuery() {
    global $SelectValue;
    global $FromValue;
    global $WhereValue;
    global $OrderValue;

    $dbquery = $SelectValue;
    $dbquery .= $FromValue;
    $dbquery .= $WhereValue;
    if ($OrderValue) {
        $dbquery .= $OrderValue;
    }
    return($dbquery);
}

Bonus snark: Language construct? What’s a language construct?

Comments