Re: question
От | Halley Pacheco de Oliveira |
---|---|
Тема | Re: question |
Дата | |
Msg-id | 20050830134333.31428.qmail@web52713.mail.yahoo.com обсуждение исходный текст |
Ответ на | question ("Matt A." <survivedsushi@yahoo.com>) |
Список | pgsql-sql |
In PHP I use this code with a prepared statement to insert null in the field justif_emenda when the value in the form is an empty string or a string with only spaces. I hope this will help you. $sql = "INSERT INTO tbl_emenda (" . "id_emenda, subtipo_emenda, tipo_emenda, " . "nome_autor, titulo_autor, login_autor," . "cod_acao_gov, nome_acao_gov, " . "texto_emenda, justif_emenda) " . "VALUES(?,?,?,?,?,?,?,?,?,nullif(trim('' from ?),''))"; $stmt = $conn->Prepare($sql); if (!$conn->Execute($stmt, array( $id_emenda, 'S', 'Aditiva', $_SESSION['nome_autor'], $_SESSION['titulo_autor'], $_SESSION['login_autor'], $_REQUEST['selCodAcaoGov'], $_REQUEST['txtNomeAcaoGov'], $_REQUEST['txtTexto'], $_REQUEST['txtJustif'] ))) { erroSQL($conn, $sql); die("Erro.."); } _______________________________________________________ Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! http://br.acesso.yahoo.com/
В списке pgsql-sql по дате отправления: