Robert1995 Posted November 2, 2011 Report Posted November 2, 2011 Cadou poate va foloseste , l-am editat dintr-un cod existent poate au aparut ceva greseli nu stiu .db_query credca se intelege ce face .function update_entry($entry_id , $data = array()) { unset($data['id']);// Prevent Mistakes $data = array_map('mysql_escape_string', $data); $data = wrap_my_array($data); $sql = 'UPDATE {table_name} SET '; $sql .= array_implode("=" , "," , $data); $sql.= ' WHERE id = %s'; $query = db_query($sql , $entry_id);}function wrap_my_array($array , $wrapper = '"') { $new_array = array(); foreach($array as $k=>$element){ if(!is_array($element)){ $new_array[$k] = $wrapper . $element . $wrapper; } } return $new_array;}function array_implode( $glue, $separator, $array ) { if ( ! is_array( $array ) ) return $array; $string = array(); foreach ( $array as $key => $val ) { if ( is_array( $val ) ) $val = implode( ',', $val ); $string[] = "{$key}{$glue}{$val}"; } return implode( $separator, $string );} Quote