For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > April 2007 > using COUNT with CGI









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author using COUNT with CGI
mmccaws2

2007-04-27, 6:58 pm

Hi

any insight would be great.

latest perl with latest mysql on OS X tiger

This works

my $sql = qq{SELECT COUNT(userid),COUNT(password) FROM members};
$sql .= qq{ WHERE userid = '$usrid' AND password = '$pass'};

but this doesn't

my $sql = qq{SELECT COUNT(userid, password) FROM members};
$sql .= qq{ WHERE userid = '$usrid' AND password = '$pass'};

error message for it is

execute failed: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near ' password) FROM members WHERE userid = 'sam' AND password =
'led'' at line 1 at

Alls i'm trying to do is verify an entry.

Thanks

Mike

nobull67@gmail.com

2007-04-27, 6:58 pm

On Apr 27, 8:49 pm, mmccaws2 <mmcc...@comcast.net> wrote:

> Subject: using COUNT with CGI


> You have an error in your SQL syntax; check the manual
> that corresponds to your MySQL server version for the right
> syntax to use


You also have an error in your ability you correctly partition
problems. This problem is not related to Perl nor to CGI.

You have an error in your SQL syntax. The best advice I can offer is
that you should check the manual that corresponds to your MySQL server
version for the right syntax to use.

Hint: what do you think COUNT() in SQL does? Compare this with the
description of what it actually does in any book on SQL.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com