develooper Front page | perl.beginners | Postings from April 2002

Re: simple problem

Thread Previous | Thread Next
From:
Jeffrey.Seger
Date:
April 29, 2002 09:01
Subject:
Re: simple problem
Message ID:
OF8797ADBF.37DC6BE5-ON85256BAA.005717B1@fairchildsemi.com

if ( $tablename > 1) is going to evaluate to false since the numeric value
of any string is 1.
Try:
if ($tablename)
or:
if (defined($tablename))

*******************************
Jeff Seger
Data Warehouse Engineer
Fairchild Semiconductor
jeffrey.seger@fairchildsemi.com
*******************************


                                                                                                                         
                    Sun-hee Kim                                                                                          
                    <sunhee@aesop.       To:     Jones Robert Contr TTMS Keesler <Robert.Jones2@keesler.af.mil>, Sun-hee 
                    com>                  Kim <sunhee@aesop.com>, beginners@perl.org, dbi-users@perl.org                 
                                         cc:                                                                             
                    04/29/2002           Subject:     Re: simple problem                                                 
                    11:57 AM                                                                                             
                                                                                                                         
                                                                                                                         




Here's the code:

if ( $tablename > 1){

$sth = $dbh->prepare("SELECT * from $tablename") || die "3: " .
$dbh->errstr;
$sth->execute();

while (my @data = $sth->fetchrow_array){
        ...........
        ..........


Sorry about that


On Monday 29 April 2002 08:50 am, Jones Robert Contr TTMS Keesler wrote:
> No code,
>   No help
>
>
> -----Original Message-----
> From: Sun-hee Kim [mailto:sunhee@aesop.com]
> Sent: Monday, April 29, 2002 10:51 AM
> To: beginners@perl.org; dbi-users@perl.org
> Subject: simple problem
>
>
> Hi,
>
> I 'm trying to pull information from a form using mysql and perl.  The
form
> has radio buttons and when i try to get the information that is selected
> for
>
> some reason its not getting it.  I was trying to say  for example if i
> select
> this option then grab all the information from that table using a select
> stmt
> and then put it in an array.  I was wondering if anyone could give me any
> ideas.
>
> thanks for any responses
> Sun-hee





Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About