[ic] SQL insert with a form

Dorothy Puma interchange-users@interchange.redhat.com
Tue Nov 20 12:47:00 2001


My database actually does an autoincrement on the Primary Key field, which works
fine when I use the
[query sql="INSERT INTO Tkt SET customerName='[value customerName]',
HelpDeskNum='[value HelpDeskNum]',serviceDate='[value serviceDate]',
LocationWork='[value LocationWork]', AfterHours='[value AfterHours]'"]
command.

I have tried adding the primary key in the "mv_data_fields":

<INPUT TYPE=HIDDEN NAME="mv_data_fields"
VALUE="tktnum,customerName,HelpDeskNum,serviceDate,LocationWork,AfterHours,
servicePerformed,host,domain">

and having an input field with the tktnum, but I still get the error.

Ticket Number: <INPUT NAME="tktnum" SIZE=30 >

What I really want to do is escape out the sinqle quotes out of my test before it
gets written to the database, as the single quotes cause an SQL error. Any ideas??

Thanks,
Dorothy

Ed LaFrance wrote:

> At 03:33 PM 11/19/2001 -0800, you wrote:
> >I have gone over the mailing lists and the docs on how to insert into a
> >table with a form. I have followed the instructions for UPDATING a
> >database
> >with a form at:
> >http://interchange.redhat.com/cgi-bin/ic/docfly.html?mv_arg=ictemplates10%2e09,
> >but I get an "Attempted database update without
> >permission". Searching through the maillist, the answer to that question
> >is to have mv_data_enable set to 1, which I do, and I still get nothing.
> >Below
> >is what I have in my form, can someone PLEASE help me.
> >
> >Thank you,
> >Dorothy Puma
> >
> >[set mv_data_enable]1[/set]
> ><FORM METHOD=POST ACTION="[process-target]">
> ><INPUT TYPE=HIDDEN NAME="mv_nextpage" VALUE="serviceticket2-sent">
> ><INPUT TYPE=HIDDEN NAME="mv_data_table" VALUE="Tkt">
> ><INPUT TYPE=HIDDEN NAME="mv_data_key" VALUE="tktnum">
> ><INPUT TYPE=HIDDEN NAME="mv_data_function" VALUE="insert">
> ><INPUT TYPE=HIDDEN NAME="mv_data_fields"
> >VALUE="customerName,HelpDeskNum,serviceDate,LocationWork,AfterHours,
> >servicePerformed,host,domain">
> ><INPUT TYPE=hidden NAME="mv_todo" VALUE="set">
> >_______________________________________________
>
> FWIW - You are missing:
>
> <input type=your_choice name=tktnum value="a_key_id">
>
> - Ed L.
>
> ===============================================================
> New Media E.M.S.               Software Solutions for Business
> 463 Main St., Suite D          eCommerce | Consulting | Hosting
> Placerville, CA  95667         edl@newmediaems.com
> (530) 622-9421                http://www.newmediaems.com
> (866) 519-4680 Toll-Free       (530) 622-9426 Fax
> ===============================================================
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users