On Mon, Dec 08, 2003 at 05:03:59PM -0500, chad kellerman wrote:
> Hello everyone,
> 
>    Trying to run a select statement but getting errors.  I know it's
> something stupid but just can't put my finger on it:
> 
> 
> $addr_slct= qq(
>            SELECT SUBSTRING_INDEX(IP, '.',2) AS addr, COUNT(*) AS
> addrsum
>            FROM tbl_masterIP  WHERE ipFree=? AND IP NOT LIKE ?
>            AND IP NOT LIKE ? GROUP BY addr;
>              );
>     $addr_count = $dbh->prepare($addr_slct);
>     $addr_count->execute("Yes", "$ip1.%", "$ip2.%", "$admin");
>     $addr_count->bind_columns(\$addr, \$count);
> 
> 
> I can run the select statemenet from the command line and everything is
> fine, but thru script it fails?
> 
> Any suggestions?

Although you haven't told us what the error message is, it appears to me
that you are passing four arguments to execute() even though your SQL
statement only has three placeholders.

Ronald

Reply via email to