Why wont this sql command work?

Red Squirrel

No Lifer
May 24, 2003
70,188
13,578
126
www.anyf.ca
I get an "out of sync" error when I try to type this command in the phpmyadmin query box:

SELECT dataobject.oid, dataobject.opid, dataobject.otype, dataobject.oownerid, dataobject_vhost.vhdomain, dataobject_vhost.vhdirectory, dataobject_vhost.vhdefault FROM dataobject , dataobject_vhost WHERE dataobject.oownerid = 1 AND dataobject_vhost.objectid=dataobject.oid;


It does not do it within my application,which is the weird part.

The structure is as follows:

Code:
CREATE TABLE `dataobject` (
  `oid` bigint(20) unsigned NOT NULL auto_increment,
  `opid` bigint(20) unsigned NOT NULL,
  `otype` char(255) NOT NULL,
  `oownerid` bigint(20) unsigned NOT NULL,
  `oserverid` bigint(20) unsigned NOT NULL,
  `oslaveserverid` bigint(20) unsigned NOT NULL,
  UNIQUE KEY `oid` (`oid`),
  KEY `opid` (`opid`,`oownerid`)
) ENGINE=MyISAM AUTO_INCREMENT=192 DEFAULT CHARSET=latin1 AUTO_INCREMENT=192 ;

CREATE TABLE `dataobject_vhost` (
  `objectid` bigint(20) NOT NULL,
  `vhdomain` text NOT NULL,
  `vhdirectory` text NOT NULL,
  `vhdefault` tinyint(4) NOT NULL,
  PRIMARY KEY  (`objectid`)
) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=latin1;


Ok this is really screwed up. Even this query does the same thing:

Code:
SELECT * FROM dataobject, dataobject_vhost;

WTF?!

This is the exact error I get:

Code:
SQL query: 

SELECT FOUND_ROWS( ) AS count;


MySQL said: 

#2014 - Commands out of sync; you can't run this command now

What's up with SELECT FOUND_ROWS( ) AS count; ? That's not the query I typed. Why is it trying to do that query?

edit: Seems if I put "limit 1" it works... but I don't want just one row, I want everything that matches! Why is it screwing around with me like this? This worked before and suddenly just stopped working. I tried restarting the mysql service and even rebooting the server.
 
Last edited:

Red Squirrel

No Lifer
May 24, 2003
70,188
13,578
126
www.anyf.ca
Just realized they work fine in the command line client, so it must be an issue with phpmyadmin. Ended up changing it anyway to use the join syntax but even join wont work in phpmyadmin, which is weird since I've seen it work before.