--- Francesco Scaglioni <[EMAIL PROTECTED]> wrote:
> Thanks and Hi again,
>
> Tried unescaping and got no joy so tried the following - still with no
> joy -any suggestions as to which obvious thing I am missing.
>
> #!/usr/bin/perl -w
> #
> # test script to query an mysql database
> #
> use stri
ted, which gives you a condition that
> is always false. I've not verified that, though (and may get
> beaten over the head for suggesting it ;-). Hope this helps.
>
> Cheers,
> Christian Sage
>
> -Ursprüngliche Nachricht-
> Von: Francesco Scaglioni [mailto:[EMAIL PROTECTED]]
> Gesendet am: Dienstag, 26. Juni 2001 13:43
> An: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Betreff: RE: ? embed scalars in the sql
>
> The following still reports nil records (I know they are there -
> honest!!).
>
The following still reports nil records (I know they are there -
honest!!).
TIA - Francesco
#!/usr/bin/perl -w
#
# test script to query an mysql database
#
use strict;
use DBI;
my ($sql, $dbh, $sth, $field1, $value1, $field2, $value2, @rows, $counter);
print "Enter the first fieldname (field1)
Take the safe option and assign the SQL query to a string before using it.
The placeholders are ok with this as well.
my $sql = qq(select * from testami where ? = ? and ? = ?);
$sth = $dbh -> prepare($sql);
$sth -> execute($field1, $value1, $field2, $value2);
#$sth -> execute();
Hope you didn
Thanks and Hi again,
Tried unescaping and got no joy so tried the following - still with no
joy -any suggestions as to which obvious thing I am missing.
#!/usr/bin/perl -w
#
# test script to query an mysql database
#
use strict;
use DBI;
my ( $dbh, $value1, $value2, $sth, @rows, $counter, $fiel
ting the script. It makes things much easier to
fix if we can see the problem. 8-)
> -Original Message-
> From: Francesco Scaglioni [mailto:[EMAIL PROTECTED]]
> Sent: 26 June 2001 10:10
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: ? embed scalars in the
Apologies for posting a small script. I created a little test table
with columns testname, testsex, testage and testcolour. The script
runs without errors yet the value of returned rows is always zero.
Please would someone be so kind as to point out the error of my ways.
TIA
Francesco
#!/usr/
That's the beauty of Perl and databases!
-Original Message-
From: "Timothy Kimball"<[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Date: Mon Jun 25 12:42:19 PDT 2001
Subject: Re: ? embed scalars in the sql
>
>: Is it possible to embed a scalar into the sql such that
: Is it possible to embed a scalar into the sql such that the value of
: the scalar could represent a column name to report or a value to
: select by
Sure. The query's just a scalar string until you execute it.
Same goes for order by, group by, table names, or whatever. Just do
yourself a favor
On Monday 25 June 2001 06:59, Francesco Scaglioni wrote:
> Hi,
>
> Is it possible to embed a scalar into the sql such that the value of
> the scalar could represent a column name to report or a value to
> select by
>
> eg something to mean the following
>
> select $column_name from test where $ano
mysql
Thanks
F
What database are you using ?
John W Moon
-Original Message-
From: Francesco Scaglioni [mailto:[EMAIL PROTECTED]]
Sent: June 25, 2001 10:59
To: [EMAIL PROTECTED]
Subject: ? embed scalars in the sql
Hi,
Is it possible to embed a scalar into the sql such that the value of
the scalar co
12 matches
Mail list logo