public function prepareInsert($table, array $values) {

        // Initialize the query.
        $query = [];

        $query[] = "INSERT INTO ";
        $query[] = $table;
        $query[] = " (`";
        $query[] = implode("`, `", array_keys($values));
        $query[] = "`) VALUES (";
        $query[] = implode(", ", array_values($values));
        $query[] = ")";

        // Return the query.
        return implode("", $query);
    }
public function prepareInsert($table, array $values) {

        // Initialize the query.
        $query = [];

        $query[] = "INSERT INTO ";
        $query[] = $table;
        $query[] = " (`";
        $query[] = implode("`, `", array_keys($values));
        $query[] = "`) VALUES (";
        $query[] = implode(", ", array_values($values));
        $query[] = ")";

        // Return the query.
        return implode("", $query);
    }
public function prepareInsert ( $ table , array $ values ) { // Initialize the query. $ query = [ ] ; $ query [ ] = "INSERT INTO " ; $ query [ ] = $ table ; $ query [ ] = " (`" ; $ query [ ] = implode ( "`, `" , array_keys ( $ values ) ) ; $ query [ ] = "`) VALUES (" ; $ query [ ] = implode ( ", " , array_values ( $ values ) ) ; $ query [ ] = ")" ; // Return the query. return implode ( "" , $ query ) ; }
Prepare an INSERT SQL query.

@param string $table The table.
@param array $values The values [field => value].
@return string Returns the INSERT SQL query.
Prepare an INSERT SQL query .