Everton,
Monday, January 21, 2002, 6:59:39 AM, you wrote:
EBY> i'm running a sql query from a php page:
EBY> if($DEl && $cid && $sid && $did) {
EBY> $d0->query("SELECT id FROM crd_favorites WHERE did='$did' AND
EBY> uid='$uid'");
EBY> if($d0->num_rows()<1) {
EBY> $favMessage="Cartao #$did nao estao no seu favoritos.";
EBY> } else {
EBY> $d0->query("DELETE FROM crd_favorites WHERE uid='$uid' AND
EBY> did='$did'");
EBY> $favMessage="Cartao #$did deletado do seu favoritos.";
EBY> }
EBY> }
EBY> my table structure:
EBY> CREATE TABLE crd_favorites (
EBY> id int(11) NOT NULL auto_increment,
EBY> uid int(11) NOT NULL default '0',
EBY> cid int(11) NOT NULL default '0',
EBY> sid int(11) NOT NULL default '0',
EBY> did int(11) NOT NULL default '0',
EBY> PRIMARY KEY (id)
EBY> ) TYPE=MyISAM COMMENT='[Cartoes] Relacionamento entre cat, sub e dat';
If you mean that queries are processed slowly - you should probably add some indexes.
CREATE TABLE crd_favorites (
id int(11) NOT NULL auto_increment,
uid int(11) NOT NULL default '0',
cid int(11) NOT NULL default '0',
sid int(11) NOT NULL default '0',
did int(11) NOT NULL default '0',
PRIMARY KEY (id),
INDEX(uid),
INDEX(did)
) TYPE=MyISAM COMMENT='[Cartoes] Relacionamento entre cat, sub e dat';
[]
EBY> if hope someone can help me because i'm with serius problem with delete and
EBY> updates queries this commands are overheading my tables... ;(
..but I'm not sure that I understand you right about so-called "overhead" problem.
Could you please tell us more.
EBY> thanks.. Everton
--
For technical support contracts, goto https://order.mysql.com/
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Egor Egorov
/ /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED]
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net
<___/ www.mysql.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php