in reply to Re^6: DBI, place holders and CGI forms
in thread DBI, place holders and CGI forms

Which idea are you referring to?

Replies are listed 'Best First'.
Re^8: DBI, place holders and CGI forms
by Anonymous Monk on Jun 17, 2011 at 15:39 UTC
    Your select advice -
    select col1, col2, col3 from tab_name where (? is null or foo = ?) a +nd (? is null or bar = ?) and (? is null or baz = ?)
    .

      I don't see how this applies to inserts. Provide an example of what you are trying to do.

        I have a got a HTML form. It has multiple fields. The data should be inserted into the database using DBI. I'd like to use placeholders in the query. They aren't all required fields. I was wondering if I could use your method for dynamically inserting values into the database, or should I just insert everything after initialising in the general form $fieldname = $cgi->param('fieldname') || null;?