in reply to Re: Object oriented mess
in thread Object oriented mess
-----------------CLIENT.PM----------------- #!/usr/bin/perl package Client; use strict; # Include Database connect file here require '/home/www/www/cgi-bin/db_connect.pl'; require '/home/www/www/cgi-bin/global_subs.pl'; sub new { my($Class) = shift; my($ClientId) = shift; my $sth = $main::dbh->prepare ("SELECT client_fname, client_lname, email, password, status FROM client_info WHERE client_id = '$ClientId' "); $sth->execute();# or &PrintMessage("$BaseDir/templates", $ErrorGen +eralTmplt, "An Error has occurred.<p><A HREF=\"#\" onclick=\"history. +back()\">click here</A> to go back.</P>", "exit"); my $hashref = $sth->fetchrow_hashref (); my $Self = [ { "FirstName" => $hashref->{'client_fname'}, "LastName" => $hashref->{'client_lname'}, "PrimaryEmail" => $hashref->{'email'}, "Password" => $hashref->{'password'}, "Status" => $hashref->{'status'}, } ]; bless $Self, $Class; } sub get_status { my($Self) = shift; return $Self->{"Status"}; } 1; -------------------------------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Object oriented mess
by dragonchild (Archbishop) on Apr 13, 2005 at 14:52 UTC | |
|
Re^3: Object oriented mess
by Joost (Canon) on Apr 13, 2005 at 14:52 UTC | |
by longliveAJ (Acolyte) on Apr 13, 2005 at 15:18 UTC | |
by Joost (Canon) on Apr 13, 2005 at 15:24 UTC |