on Tue, 14 May 2002 18:57:56 GMT, Jim-Cont Flaherty wrote:

>   while( $questions_asked =~ /!([^!]*)/g) {
>  
>       my $num1 = $1;
>  
>  
> print " This is a test:  $num1<BR>";   # this statement for debug
>  
> my $sth1 = $dbh -> prepare("select * from tests where num  = '$num1'
> "); 
>  
> $sth1 -> execute or die " unable to execute query ";
>  
> #$sth1 -> finish;
>  
> my $array_ref = $sth1 -> fetchall_arrayref();

Change the prepare to 

        my $sth1 = $dbh->prepare("select * from tests where num  = ?");

and move it out of the while loop.

Change you execute statement into

        $sth1->execute($num1) or die " unable to execute query ";


Don't 'finish' before you have fetched.

-- 
felix

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to