Search Results

Search found 1 results on 1 pages for 'user1533106'.

Page 1/1 | 1 

  • Best way to not update empty posts

    - by user1533106
    Hello, Im using codeigniter, and the page in case just update infos about an user. If the user go to the page and edit values and that posts come as "" or empty (samething) then no update it let the query pass it, i got a logic but its a bit ugly and ill take alot of time. $nome = "'nome' =>" . $this->input->post('nome') . "'"; $sobrenome = "'sobrenome' =>" . $this->input->post('sobrenome') . "'"; if($nome != ""){ $nome = "'nome' =>" . $this->input->post('nome') . "'"; }else{ $nome = ""; } if($sobrenome != ""){ $sobrenome = "'sobrenome' =>" . $this->input->post('sobrenome') . "'"; }else{ $sobrenome = ""; } $data = array($nome, $sobrenome); The problem is, i got alot of fields :( If anyone know a smart way or a better way, please i want know

    Read the article

1