Good day :)
<<== new, please excuse If I post shit :)
I've one query which doesn't work:
SELECT
conquer.timestamp AS time,
conquer.new_owner AS new_owner_id
FROM de12_conquer AS conquer
INNER JOIN de12_tribe AS conqueror ON conqueror.id=conquer.new_owner
INNER JOIN de12_tribe AS loser ON loser.id=conquer.old_owner
WHERE (conquer.timestamp>0 && conquer.timestamp<1213647029734) AND (conqueror.ally=37038 OR loser.ally=37038 )
ORDER BY conquer.timestamp DESC LIMIT 50
This query doesn't work .... mysql server has gone away is the return or nothing... just loading :(
I've located the problem with a second query which works:
SELECT
conquer.timestamp AS time,
conquer.new_owner AS new_owner_id
FROM de12_conquer AS conquer
INNER JOIN de12_tribe AS conqueror ON conqueror.id=conquer.new_owner
WHERE (conquer.timestamp>0 && conquer.timestamp<1213647029734) AND (conqueror.ally=37038 )
ORDER BY conquer.timestamp DESC LIMIT 50
As you can see the both query have only 1 different INNER JOIN (ignore the additional where-condition):
INNER JOIN de12_tribe AS loser ON loser.id=conquer.old_owner
This line is "crashing" MySQl... but why ????
Structures of the tables:
CREATE TABLE IF NOT EXISTS `de12_tribe` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL default '',
`ally` int(11) NOT NULL,
`villages` int(5) NOT NULL,
`points` int(11) NOT NULL,
`rank` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `de12_conquer` (
`villageid` int(11) NOT NULL,
`timestamp` int(11) NOT NULL,
`new_owner` int(11) NOT NULL,
`old_owner` int(11) NOT NULL,
KEY `villageid` (`villageid`),
KEY `timestamp` (`timestamp`),
KEY `new_owner` (`new_owner`),
KEY `old_owner` (`old_owner`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
I hope you can help me, thanks !!
dispy