src/UI/CrudForm.php
public static function selectSql($tablename, $fields, $where_clause=false) {
        $sql = "SELECT ";
        $first = true;
        foreach ( $fields as $field ) {
            if ( ! $first ) $sql .= ', ';
            $sql .= $field;
            $first = false;
        }
        $sql .= "\n FROM ".$tablename;
        if ( $where_clause && strlen($where_clause) > 0 ) $sql .= "\nWHERE ".$where_clause;
        return $sql;
    }
public static function selectSql($tablename, $fields, $where_clause=false) {
        $sql = "SELECT ";
        $first = true;
        foreach ( $fields as $field ) {
            if ( ! $first ) $sql .= ', ';
            $sql .= $field;
            $first = false;
        }
        $sql .= "\n FROM ".$tablename;
        if ( $where_clause && strlen($where_clause) > 0 ) $sql .= "\nWHERE ".$where_clause;
        return $sql;
    }
public static function selectSql ( $ tablename , $ fields , $ where_clause = false ) { $ sql = "SELECT " ; $ first = true ; foreach ( $ fields as $ field ) { if ( ! $ first ) $ sql .= ', ' ; $ sql .= $ field ; $ first = false ; } $ sql .= "\n FROM " . $ tablename ; if ( $ where_clause && strlen ( $ where_clause ) > 0 ) $ sql .= "\nWHERE " . $ where_clause ; return $ sql ; }
Produce the SELECT statement for a table, set of fields and where clause.

@param $fields An array of field names to select.
@param $where_clause This is the WHERE clause but should not include
the WHERE keyword.
Produce the SELECT statement for a table set of fields and where clause .