you never executed the SQL statment
$sth->execute();
> -Original Message-
> From: Soheil Shaghaghi [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, July 27, 2002 2:05 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: What's wrong with this code?
>
>
See inline comment.
Soheil Shaghaghi wrote:
> Hi everyone,
> Can anyone please tell me what the problem is with this code?
> Every time I run my program with this code in it, I get an error in the log
> files:
> DBD::mysql::st fetchrow_array failed: fetch() without execute() at
> IWeb/sqlengine.p
Hi everyone,
Can anyone please tell me what the problem is with this code?
Every time I run my program with this code in it, I get an error in the log
files:
DBD::mysql::st fetchrow_array failed: fetch() without execute() at
IWeb/sqlengine.pm line 3395.
sub SQL_Is_Sponsor {
my ($link_id) = @_
Terminology not withstanding, it's again the lexical scoping.
Basically, what you're doing wrong is by declaring the scalar test inside the
while block.
As long as the code is exiting within the while block, $test is still alive.
The code exits out of the while block and $test is no more.
Also- b
PROTECTED]
- Original Message -
From: Kyle Babich <[EMAIL PROTECTED]>
To: beginners-cgi <[EMAIL PROTECTED]>
Sent: Monday, July 01, 2002 1:36 PM
Subject: Re: What's wrong with this?
> Quer ter seu próprio endereço na Internet?
> Garanta já o seu e ainda g
> open(TEXT,"text.txt") or die ("error: text.txt failed\n");
> while () {
> my $text = ;
> }
>
> It tells me $text requires explicit package name but I do give it 'my'
> so why is it still giving me that error?
The $text has fallen out of scope. Lexical variables (d
Ok, thank you, but now I'm having another problem with this:
open(TEXT,"text.txt") or die ("error: text.txt failed\n");
while () {
my $text = ;
}
close(TEXT) or die("error: close text.txt failed\n");
print <<"EndOfHTML";
$text
EndOfHTML
It tells me $text requ
>Try to use(UpperCase):
> open(TEXT,"text.txt")
> while()
Also, if you're using Perl >= 5.6.0, use the $fh notation and get around
the barewords entirely.
open( my $fh, "text.txt" ) or die $!;
while ( <$fh> ) {
# whatever
}
close $fh;
--
'Andy Lester[E
on Mon, 01 Jul 2002 15:22:00 GMT, [EMAIL PROTECTED] (Kyle Babich) wrote:
> open(text,"text.txt") or die ("error: text.txt failed\n");
> [...]
> bash-2.05$ perl -Tcw index.pl
> Unquoted string "text" may clash with future reserved word at
> index.pl line 17.
> [..]
> How do I fix it?
>From p
ux / Security
[EMAIL PROTECTED]
- Original Message -
From: Kyle Babich <[EMAIL PROTECTED]>
To: beginners-cgi <[EMAIL PROTECTED]>
Sent: Monday, July 01, 2002 12:22 PM
Subject: What's wrong with this?
> Quer ter seu próprio endereço na Internet?
> G
open(text,"text.txt") or die ("error: text.txt failed\n"); #line
17
while()
{
print $_;
}
close(text) or die("error: close text.txt failed\n"); #line
22
bash-2.05$ perl -Tcw index.pl
Unquoted string "text" may clash
11 matches
Mail list logo