i had a large databse and had to chec if a email is in a special group I had to tables.
first tabel called user
CREATE TABLE user ( uid int(10) NOT NULL AUTO_INCREMENT, kid int(3) NOT NULL, Email varchar(255) DEFAULT NULL, PRIMARY KEY (uid), KEY kid (kid) ) ENGINE=MyISAM and a table named group
CREATE TABLE `group` ( `vuid` int(10) NOT NULL AUTO_INCREMENT, `uid` int(3) NOT NULL, `vid` int(3) NOT NULL, PRIMARY KEY (`vuid`) ) ENGINE=MyISAM and for every insert i had a defined vid and a email Now i had to check, if a user with the uid is in the group vid.
select a.email,b.vuid from user a, group b where a.email=\''.$email.'\' and a.kid=' . $kid.' and b.vid=' . $vid . ' and a.uid = b.uid limit 1')
and check if the mysql_fetch_assoc is true or false.
BUT this is verry verry slow. is there a simple way to speed up ?