in reply to Re: Re: Re: Re: No results from script
in thread No results from script
cool.. In get_customer() your customer id is being put into $dbh. As you assign directly to $dbh you don't need it in that first line, so..
change: sub get_customer { my ($dbh, $customer_id) = @_; $dbh = WebDB::connect (); ... to: sub get_customer { my ($customer_id) = @_; my $dbh = WebDB::connect ();
Now you really want to keep the subs separate, so instead of calling get_customer from print_results we get_customer, then send the customer details to print results..
if ($choice eq "submit") # customer submitted order number { get_customer (); print_results (); } else ... becomes: if ($choice eq "submit") # customer submitted order number { my $cutomer = get_customer($customer_id); print_results($customer); } else ...
Then we change print_results to accept the customer details as an argument
sub print_results { my $customer = get_customer($customer_id); ... becomes: sub print_results { my $customer = @_;
cheers,
J
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Re: No results from script
by b310 (Scribe) on Jun 04, 2003 at 16:12 UTC | |
by edoc (Chaplain) on Jun 04, 2003 at 16:21 UTC | |
by b310 (Scribe) on Jun 04, 2003 at 19:15 UTC | |
by edoc (Chaplain) on Jun 04, 2003 at 23:28 UTC | |
by edoc (Chaplain) on Jun 05, 2003 at 07:28 UTC |