|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I hope this is the right place to post - I have a problem with mSQL
which I'm sure is just due to something silly which as someone new to mSQL I have just missed out. I'm trying to write a program, as below, which takes info from a form and checks a table to see if the userid has been created before. The program runs through ok and prints out the HTML at the end, but when I re-run the program it does exactly the same - though it should show a different page (the else info that is missing from the below) as the user has already been entered into the dbase. Help! PK #!/usr/bin/perl use strict; use CGI; use Msql; my $qr = new CGI; my $qo = new CGI; $qr->import_names( "res" ); my $usertemp = $res::userid; my $db = Msql->connect; $db->selectdb('emcdbase'); my $sq = "SELECT userid FROM personaldata WHERE userid = $res::userid "; my $output = $db->query($sq); my @values = $output->fetchrow; if ($values[0] ne $usertemp) { my $outputed = $db->query("INSERT INTO personaldata (userid, fname, sname, address1, address2, town, county, pcode, country, phone) VALUES ( $res::userid, $res::fname, $res::sname, $res::address1, $res::address2, $res::town, $res::town, $res::county, $res: URLcode, $res::country, $res: URLhone"); my $created = $db->query("SELECT userid FROM personaldata WHERE userid = $usertemp "); my $person = $created->as_string; print <<END_OF_MESSAGE; Content-type: text/html # Rest of HTML deleted |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > mSQL.pm beginner needs help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|