I'm trying this:
my $sth = $dbh->prepare( "SELECT count(*) FROM quotesgiven WHERE quotenumber = $info[0] and quotedby = $username" );
$sth->execute or print("Cannot execute statement!<br>".$sth->errstr);
my $rs = $sth->fetchall_arrayref();
my $count = $rs->[0]->[0];
But I'm getting the error:
Cannot execute statement!
Unknown column 'kevin' in 'where clause'
If I leave the second where out it works fine as:
my $sth = $dbh->prepare( "SELECT count(*) FROM quotesgiven WHERE quotenumber = $info[0]" );
$sth->execute or print("Cannot execute statement!<br>".$sth->errstr);
my $rs = $sth->fetchall_arrayref();
my $count = $rs->[0]->[0];
Any ideas?
my $sth = $dbh->prepare( "SELECT count(*) FROM quotesgiven WHERE quotenumber = $info[0] and quotedby = $username" );
$sth->execute or print("Cannot execute statement!<br>".$sth->errstr);
my $rs = $sth->fetchall_arrayref();
my $count = $rs->[0]->[0];
But I'm getting the error:
Cannot execute statement!
Unknown column 'kevin' in 'where clause'
If I leave the second where out it works fine as:
my $sth = $dbh->prepare( "SELECT count(*) FROM quotesgiven WHERE quotenumber = $info[0]" );
$sth->execute or print("Cannot execute statement!<br>".$sth->errstr);
my $rs = $sth->fetchall_arrayref();
my $count = $rs->[0]->[0];
Any ideas?