- /*
- $db = new PDO('sqlsrv:server=SQLSERVERNAME;Database=own_exchange', 'user', 'password');
- $sql = "INSERT INTO dbo.files(file_name, file_source) VALUES(:file_name, :file_source)";
- $stmt = $db->prepare($sql);
- $stmt->bindParam(":file_name", $files->name, PDO::PARAM_STR);
- $stmt->bindParam(":file_source", file_get_contents($files->tempName), PDO::PARAM_LOB, 0, PDO::SQLSRV_ENCODING_BINARY);
- $stmt->execute();
-
-
- $stmt = $dbh->prepare("INSERT INTO tExample (id,value) VALUES (:id,:value)");
- $taValues = array(
- 'id' => '1',
- 'value' => '2'
- ); // array
- PDOBindArray($stmt,$taValues);
- $stmt->execute();
-
+ public function update($table, $data, $condition)
+ {
+ if (!is_array($data)) throw Exception('update called without data array');
+ if (empty($condition)) throw Exception('update called without condition');