Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Re: andling form data

by bar10der (Beadle)
on Apr 14, 2004 at 10:43 UTC ( #345073=note: print w/replies, xml ) Need Help??

in reply to Re: andling form data
in thread Putting a long form into a database

Thanks Matija for your help. My table has column names same as field names in the form. So I think 1st part of the code will work for me. However I am not sure about one thing -

what happens if a field in the form is left blank? Will $val contain null for that field?

Replies are listed 'Best First'.
Re: Re: Re: andling form data
by matija (Priest) on Apr 14, 2004 at 12:26 UTC
    If the browser doesn't pass the empty field (which most browsers don't I think), then it won't be set at all (that is part of the purpose of enumerating the fieldnames in the INSERT statement) and it's value will be whatever default you set up for the table - most probably NULL or empty string.

    If the browser does pass fields without values entered, then they will be set to empty string in the database.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://345073]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (1)
As of 2021-09-26 13:59 GMT
Find Nodes?
    Voting Booth?

    No recent polls found