using COUNT with CGI



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

.



Relevant Pages

  • Re: Alte Daten verschieben
    ... ERROR 1064 at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right ...
    (de.comp.datenbanken.mysql)
  • Re: RE : SQL Syntax quickie
    ... mysql> select maxfrom test2; ... *Never* test your SQL through a programming interface. ... Only when you know the tested and proven SQL syntax that extracts ...
    (perl.beginners)
  • Re: Creating a view
    ... Whit wrote: ... You have an error in your SQL syntax; ... So make sure the version of MySQL you have supports view. ... The ';' in the SQL statement is fine. ...
    (comp.lang.php)
  • Re: please help - mysterious extra characters appearing in SQL update
    ... sends a simple update sql command to mysql 5. ... in your SQL syntax; check the manual that corresponds to your MySQL ... Works fine in the MySQL Query Browser. ...
    (microsoft.public.inetserver.asp.db)
  • OT SQL
    ... I am trying to set up my MySQL Database on an older version than it is ... I dumped my SQL and it is... ... but when i try and run this sql in PHPMyAdmin I get the error message ... #1064 - You have an error in your SQL syntax. ...
    (alt.php)