Gossamer Forum
Quote Reply
Annoying SQL Statement!
Please...can anyone see why this won't work?

Code:
my $sth = $table->select( { SetID => \$ID, Password => "$Password" } );

For some reason, the query always comes out like;

SELECT * FROM links2CatAdverts WHERE SetID = 3 AND Password = magnum

Notice the lack of quotes around the Password = value part. This seems to be causing an error. See below;

GT::SQL::error = Failed to execute query: 'SELECT * FROM links2CatAdverts WHERE SetID = 3 AND Password = magnum ' Reason: Unknown column 'magnum' in 'where clause'

I've tried several versions of the code, such as;

Code:
my $sth = $table->select( { SetID => \$ID, Password => \"$Password" } );

my $sth = $table->select( { SetID => \$ID, Password => \$Password } );

my $sth = $table->select( { SetID => \$ID, Password => \'$Password' } );

...and thats about it Unsure

Anyone got any ideas? This one really has me stumped.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread; hot thread Annoying SQL Statement! Andy 8506 Feb 11, 2003, 2:45 AM
Post; hot thread Re: [Andy] Annoying SQL Statement!
Paul 8211 Feb 11, 2003, 2:53 AM
Thread; hot thread Re: [Andy] Annoying SQL Statement!
yogi 8310 Feb 11, 2003, 2:54 AM
Thread; hot thread Re: [yogi] Annoying SQL Statement!
Andy 8309 Feb 11, 2003, 3:01 AM
Thread; hot thread Re: [Andy] Annoying SQL Statement!
yogi 8235 Feb 11, 2003, 3:03 AM
Thread; hot thread Re: [yogi] Annoying SQL Statement!
Andy 8258 Feb 11, 2003, 3:19 AM
Thread; hot thread Re: [Andy] Annoying SQL Statement!
Paul 8212 Feb 11, 2003, 3:36 AM
Thread; hot thread Re: [Paul] Annoying SQL Statement!
Andy 8216 Feb 11, 2003, 4:47 AM
Thread; hot thread Re: [Andy] Annoying SQL Statement!
Paul 8200 Feb 11, 2003, 5:50 AM
Post; hot thread Re: [Paul] Annoying SQL Statement!
Andy 8189 Feb 11, 2003, 6:45 AM
Thread; hot thread Re: [Paul] Annoying SQL Statement!
Andy 8244 Feb 11, 2003, 7:11 AM
Thread; hot thread Re: [Andy] Annoying SQL Statement!
Paul 8267 Feb 11, 2003, 7:24 AM
Thread; hot thread Re: [Paul] Annoying SQL Statement!
Andy 8283 Feb 11, 2003, 7:28 AM
Post; hot thread Re: [Andy] Annoying SQL Statement!
Paul 8225 Feb 11, 2003, 7:41 AM
Thread; hot thread Re: [Andy] Annoying SQL Statement!
yogi 8193 Feb 11, 2003, 7:47 AM
Thread; hot thread Re: [yogi] Annoying SQL Statement!
Andy 8211 Feb 11, 2003, 7:49 AM
Thread; hot thread Re: [Andy] Annoying SQL Statement!
yogi 8237 Feb 11, 2003, 7:51 AM
Thread; hot thread Re: [yogi] Annoying SQL Statement!
Andy 8202 Feb 11, 2003, 7:56 AM
Post; hot thread Re: [Andy] Annoying SQL Statement!
Paul 8167 Feb 11, 2003, 8:37 AM