Skip to main content
Inspiring
July 15, 2006
Question

Problem with mysql queries using 'bitwise and' operator - '&'

  • July 15, 2006
  • 2 replies
  • 580 views
It seems that dreamweaver's php/mysql model does not properly handle a query
that uses the mysql bitwise operator '&'.

Test case to demonstrate this:

1) create database:
CREATE TABLE bitwisetest (
id smallint(6) NOT NULL default '0',
number1 int(4) NOT NULL default '0',
number2 int(4) NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;

INSERT INTO bitwisetest VALUES (1, 1, 1);
INSERT INTO bitwisetest VALUES (2, 2, 1);
INSERT INTO bitwisetest VALUES (3, 4, 2);
INSERT INTO bitwisetest VALUES (4, 6, 4);
INSERT INTO bitwisetest VALUES (5, 6, 4);
INSERT INTO bitwisetest VALUES (6, 9, 1);
INSERT INTO bitwisetest VALUES (7, 9, 3);
INSERT INTO bitwisetest VALUES (8, 9, 6);
INSERT INTO bitwisetest VALUES (10, 1234, 78);
INSERT INTO bitwisetest VALUES (11, 2345, 567);
2) Create recordset with either of the following SQL statements:
SELECT * FROM `bitwisetest` WHERE (number1 & number2)

SELECT (number1 & number2) FROM `bitwisetest`
Although MySQL itself has no trouble handling either of these queries, when
I have either one in a Recordset dialog box and click 'test', or try to view
the result set placeholders in the Bindings panel by clicking the '[+]'
beside the recordset name, DW reports the following error:
MySQL Error#: 1064
You have an error in your SQL syntax near '' at line 1
and the result set placeholders are not available in the Bindings panel.

Is there some Dreamweaver setting I am missing or adjustment I can make to
Dreamweaver so that it can handle these queries properly?



This topic has been closed for replies.

2 replies

Inspiring
July 16, 2006
Thanks for the confirmation. I have filed a bug report.

"David Powers" <david@example.com> wrote in message
news:e9bt2s$1sk$1@forums.macromedia.com...
> Owen Gray wrote:
>> It seems that dreamweaver's php/mysql model does not properly handle a
>> query
>> that uses the mysql bitwise operator '&'.
>
> I have never really understood the bitwise operator, but I can confirm
> that your bitwisetest fails in Dreamweaver, but works in MySQL and in PHP.
> (I just hand-coded the results from the recordset in Dreamweaver, rather
> than using the Bindings panel.) I suspect it's a bug in the JavaScript
> routines that run the background of Dreamweaver.
>
> I suggest that you file a bug report to the Dreamweaver team:
>
> http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
>
> --
> David Powers
> Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
> Author, "Foundation PHP 5 for Flash" (friends of ED)
> http://foundationphp.com/


Inspiring
July 15, 2006
Owen Gray wrote:
> It seems that dreamweaver's php/mysql model does not properly handle a query
> that uses the mysql bitwise operator '&'.

I have never really understood the bitwise operator, but I can confirm
that your bitwisetest fails in Dreamweaver, but works in MySQL and in
PHP. (I just hand-coded the results from the recordset in Dreamweaver,
rather than using the Bindings panel.) I suspect it's a bug in the
JavaScript routines that run the background of Dreamweaver.

I suggest that you file a bug report to the Dreamweaver team:

http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

--
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/