Em Andamento

PHP code snippet to handle ''0'' and NULL values

Hello,

I'm using PHP. I have a form with a text field (<input name="a1" type="text" size="5">). If a user types "0", "0.0" or "0.00" , I want to insert "0" into my mysql db. If a user leaves the field blank, I want to insert NULL into the db.

My own efforts have been unsuccessful. My code keeps inserting "0" into my db even when the field is left blank.

I can write the PHP/SQL statement to update the database so you don't have to do that. I just need a snippet of code to successfully interpret "zero" values and NULL values, i.e.

if (is_null($a1))

{

do this...

} else {

do that...

}

... or something similar!

Thanks.

## Deliverables

1) Solution to problem outlined in Description.

2) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).

## Platform

PHP

MySQL

Unix

Habilidades: Engenharia, MySQL, PHP, Arquitetura de software, Teste de Software

Ver mais: work values, statement problem, program problem statement, my code, i want to write my own, components of a problem statement, php code program, snippet, null, handle, sql update field text, php sql code, mysql else insert, mysql update else, code copyright, update code sql, insert php code form, sql update text field, mysql update values, update insert sql, update values mysql, update field sql field field, php sql update, php code write, engineering program source code

Acerca do Empregador:
( 127 comentários ) United Kingdom

ID do Projeto: #2983643

Premiar a:

royalsoftvw

See private message.

$1 USD em 2 dias
(20 Avaliações)
4.2

9 freelancers estão ofertando em média $7 para este trabalho

jmper

See private message.

$8.5 USD in 2 dias
(99 Comentários)
7.2
intelliron

See private message.

$17.85 USD in 2 dias
(19 Comentários)
4.7
vw228784vw

See private message.

$8.5 USD in 2 dias
(13 Comentários)
4.1
chorlya

See private message.

$6.8 USD in 2 dias
(11 Comentários)
3.6
felenkavw

See private message.

$4.25 USD in 2 dias
(26 Comentários)
3.4
creativetechies

See private message.

$4.25 USD in 2 dias
(9 Comentários)
3.2
cowboyatheart

See private message.

$4.25 USD in 2 dias
(3 Comentários)
2.3
vw663461vw

See private message.

$6.8 USD in 2 dias
(4 Comentários)
2.6