Re: possible bug in PHP function mysql_query() ?
Peter Walter wrote:
> MySQL version: 4.0.16
> PHP version: 4.3.2
>
> Problem code:
> $query = "SELECT * FROM tablename
> WHERE columnname LIKE '%<any_eight_digits>%'";
> mysql_query($query);
>
> Results:
> query fails, mysql_errno() returns 1064 (syntax error)
>
> I have tracked the problem down to the WHERE clause; using any other
> number of digits (except eight), the query suceeds. It seems to be a
> problem with the comparison logic, because other comparison operators
> also fail; specifically, I have tested
> WHERE columnname = <any_eight_digits>
> and
> WHERE columnname = '<any_eight_digits>'
>
>
> When running the identical query in PhpMyAdmin 2.5.5 RC1, or at the
> MySQL command line, the query works without a problem.
>
> I am a PHP/MySQL newbie. Before I rush off and report this as a PHP bug,
> can anyone else confirm this behavior, or explain what I am doing wrong?
>
> Peter
Can you show us the exact query? I doubt this is a PHP or MySQL bug.
It would be nice to see the actual query exactly as it would go to the
mysql server.
-Calico Jack-
|