VI
dúvida

Database error

Por ViTiNhO145, 21 de mar. de 2013 em Websites

resolvido
otserv
6
1.2k
ViTiNhO145V
21 de março de 2013 às 05:55

Alguem poderia me ajudar com esse erro:

 

 

 

A Database Error Occurred

 

Error Number: 1146

Table 'otserv.poll_votes' doesn't exist

SELECT * FROM poll_votes WHERE answer_id = 0

WebTutoriaisW
21 de março de 2013 às 09:08

Colocou O Nome Correto Da Database Na Config.lua?

ViTiNhO145V
21 de março de 2013 às 09:19

Sim :c

tyuahoiT
21 de março de 2013 às 09:56

execute esses comandos na sua database POR ORDEM.

 

 

DROP TABLE poll_votes;

 

 

CREATE TABLE IF NOT EXISTS `poll_votes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`answer_id` int(11) DEFAULT NULL,
`poll_id` int(11) DEFAULT NULL,
`account_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `poll_id` (`poll_id`),
KEY `account_id` (`account_id`),
KEY `answer_id` (`answer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

 

ALTER TABLE `poll_votes`
ADD CONSTRAINT `poll_votes_ibfk_1` FOREIGN KEY (`answer_id`) REFERENCES `poll_answer` (`id`),
ADD CONSTRAINT `poll_votes_ibfk_2` FOREIGN KEY (`poll_id`) REFERENCES `poll` (`id`),
ADD CONSTRAINT `poll_votes_ibfk_3` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`);

 

não esqueça, 1 por vez.

Editado Março 21 por 1tyi

ViTiNhO145V
21 de março de 2013 às 19:01

execute esses comandos na sua database POR ORDEM.

 

 

DROP TABLE poll_votes;

 

 

CREATE TABLE IF NOT EXISTS `poll_votes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`answer_id` int(11) DEFAULT NULL,
`poll_id` int(11) DEFAULT NULL,
`account_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `poll_id` (`poll_id`),
KEY `account_id` (`account_id`),
KEY `answer_id` (`answer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

 

ALTER TABLE `poll_votes`
ADD CONSTRAINT `poll_votes_ibfk_1` FOREIGN KEY (`answer_id`) REFERENCES `poll_answer` (`id`),
ADD CONSTRAINT `poll_votes_ibfk_2` FOREIGN KEY (`poll_id`) REFERENCES `poll` (`id`),
ADD CONSTRAINT `poll_votes_ibfk_3` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`);

 

não esqueça, 1 por vez.

 

 

Muito obrigado funciono ^^ REP+

RoksasR
21 de março de 2013 às 19:22

Tópico movido para a seção de dúvidas e pedidos resolvidos.