Rookie write two questions in CGI program with C

The rookie just contact CGI, two existing problems:
1, Why am I in the C code for
TCHAR sql[256];
result = SQLPrepare(hstmt,(SQLCHAR*)sql,SQL_NTS);
The teacher told the c+sql statement cannot realize the updates to the database.?
2, Write a CGI program, and then type the address in the browser, for example, has entered a webpage (should be called webpage, but not HTML) should be the input parameters in the webpage on how in the CGI.exe program code.?
Thank you!

Started by Paula at November 12, 2016 - 5:19 PM

The first problem is not know...
The second is to obtain the form! Get and post two methods, see you with what kind of! But generally with post method!
PS: To obtain the parameters by another CGI procedure! Don't know what to say and know not? !
Describe in detail, or directly on the detailed code

Posted by Kenny at November 27, 2016 - 5:23 PM

For a C written by CGI program, the database implementation of additions.

Posted by Paula at December 01, 2016 - 6:02 PM

Write your own C for MYsql operation.
The operation of the database in this part, in the CGI and C is written with the same.

Posted by Bertram at December 12, 2016 - 6:22 PM

I use c+mysql, you can update, can not update how to live ah
As for the CGI transmission parameters, form get and post cent, get parameters directly behind URL, by? Separate; through the environment variable QUERY_STRING acquisition, while the post parameter is not pass, but the length of the parameter in the CONTENT_STRING environment variable, can be recycled getchar () to obtain a single character

Posted by Gloria at December 17, 2016 - 6:26 PM

Check the CGIC Library

Posted by Nelson at December 29, 2016 - 6:59 PM

Generation after generation is the generation after generation in fact born and death and death

Posted by Barton at January 02, 2017 - 7:57 PM

The second question I tried, divided into get and post, to own function, about 30 lines of work.
Go online to search a ready-made function is also a good choice.

Posted by Enoch at January 03, 2017 - 7:06 PM

Top up.

Posted by Godfery at January 12, 2017 - 7:31 PM