Perl and CGI

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentPerl and CGI

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old September 11th, 2008, 09:08 PM
ccrstaff ccrstaff is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 2 ccrstaff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 54 sec
Reputation Power: 0
SQL Not Producing Desired Results

I'm new to CGI and I'm trying to write a simple test script to grab a value from a database table and print it. When I run the script it returns a blank page. I'm using the same script I used to insert a record into the table, so the connection to the database should be fine. I'm not getting errors at all. I know there is a record in the database that matches the entry on the form. Here's what I have for the connection to the database and the SQL:

my $DSN = 'driver=Microsoft Access Driver (*.mdb);dbq=C:\Documents and Settings\Mike\My Documents\My Website\Clients.mdb';
my $dbh = DBI->connect("DBI:ODBC:$DSN")
or die "$DBI::errstr\n";
$::db_host = 'localhost';
$::db_name = 'Clients.mdb';
$::db_user = 'root';

my $sth = $dbh->prepare("SELECT fname FROM tblClients WHERE mail_id = '$mail_id'");

$sth->execute;
($fname) = $sth->fetchrow();

while (my $fname_href = $sth->fetchrow_hashref)
{

print $fname_href->('fname') . br;

}

If someone could please give me a clue I would really appreciate it. Thank you in advance for any help or suggestions

Mike

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentPerl and CGI > SQL Not Producing Desired Results


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap