Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function update($table, $values = array(), $where){
- $sql = "UPDATE $table SET ";
- $i = 0;
- foreach($values as $row => $value){
- ++$i;
- if($i < count($values)){
- $sql .= $row.' = '.$value.', ';
- }else{
- $sql .= $row.' = '.$value;
- }
- }
- $sql .= " WHERE $where";
- return $sql;
- //$this->query($sql);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement