Code:
#! c:/perl/bin/perl.exe use CGI qw(:standard); use DBI; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); $dbh = DBI->connect("DBI:mysql:database=perldbi;host=localhost","root",""); $sth = $dbh->prepare('select * from foo1'); $sth->execute(); print header; print start_html('Newgen'); print h1("DBI SAMPLES"); print "User NAME: <input type='text' name='user'><br>"; print "<input type='button' value='Login' name='login'>"; if($sth->rows == 0) { #print "No information for " . $R:lace; } else { print "<table border=2>\n"; while( $resptr = $sth->fetchrow_hashref() ) { print "<tr>"; print "<td>" . $resptr->{"usrid"}; print "<td>" . $resptr->{"pass"}; print "\n"; print "<\/tr>"; } print "</table>\n"; } $dbh->disconnect; print end_html;
For this I have One Textbox and Button
IF am enter the values in that textbox and when am clicking that button,
The particular record in the text box must be insert into the tables.
ThanX
Comment