Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A button for an sql istruction 1

Status
Not open for further replies.

erikkk

Programmer
Jun 25, 2001
12
0
0
IT
Hi, How can I use a button to associate it an sql istruction? Something like: "insert into.." or "select.."

Thank you!
 
Greetings Erikkk:

That, Erikkk, is a very large question, and too large to be able to answer you properly in this forum. In fact, with all the underlying code and methods that is/are associated with your question, books have been written on less.

I will assume that you are using some sort of HTML form (there are many ways to create the input form, not just bare HTML) that you want to pass the information to a backend SQL database. I will only provide the process in this answer, for the reason given in the paragraph above.

Your HTML form must use the "post or get method" when your visitor clicks on the "Insert Into" button. The information contained in the form is passed and parsed to a PERL/CGI script, (there are also other languages like C, C++, Java, etc., but I am using PERL here for explanation) including a DBI script to open the database and "insert" the parsed data into your database table. I assume that you have created the database and the corresponding table into which you want the data inserted.

Now that you have the corresponding form fields filled in the table, you must be able to retrieve the information in a usable form. So, you do all the above in reverse, with the exception that you embed (recommended) the HTML code in a PERL script to "use" the data in in a way that you wish.

So, you must use a "select" command in your PERL/CGI script that selects the various fields (you may choose the field or fields that you want to display), in the order that you want, parse the data, and then display it in an embedded HTML table (or some other display) with a .cgi or .pl extension. That process usually includes another "button" or "href" to evoke the select script.

So, your question is a very large one, and there are as many answers as there are programmers. I have just glossed over a single process that hopefully will give you some direction to create the application that you require using the scripting language(s) that you know.

CSC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top