Problem with registration in codeigniter

1

I have a course site made with codeigniter and an error is occurring when I register for a specific address, in this case link instead of the data being included in the database, it returns the following error, for example:


An Error Was Encountered

Error Number: 1054

Unknown column 'redirect' in 'field list'

INSERT INTO 'usuarios' ('nome', 'estado', 'cidade', 'pais', 'cep', 'endereco', 'numero', 'bairro', 'telefone', 'como_conheceu', 'email', 'senha', 'redirect', 'data_cadastro_usuario', 'valido', 'hashing') VALUES ('Cadastro de Testes', 'MG', 'Montes Claros', 'Brasil', '39404000', 'Endereço de teste', '104A', 'Bairro de teste', '3899999999', 'nao sei', '[email protected]', '123456', 'site/curso_matricular/13732', '2015-03-20', 'Sim', 'puowqxalnce8jsh6e5swfcte244rpl3gmixwb65mb1187kj42m1nkwv2pvpizvb5gfh2apllzjr5n3v23mvwb1iny26qyfrlnc30')

But only when you are registered by this address. What could be happening?

    
asked by anonymous 20.03.2015 / 23:58

2 answers

1

Verify that you actually have the redirect column in your usuarios table. You are probably using a different controller to do the registration when the user is signing up from a course.

From what I've noticed, you want to create a sort of redirection after the confirmation of the registration. If this is indeed your wish try using a PHP Session to store the redirection location and then use a function of Helper of URL's of CodeIgniter itself as:

 redirect($_SESSION['redirect_curso'], 'refresh');

For more information, refer to the documentation in this link and to better understand how to do the redirect see this link .

    
21.03.2015 / 05:04
0

Probably your PHP script is erroneously adding "redirect" as a select column, and that column does not exist in the users table in the database.

Simply correct this part of the script that the error will not happen anymore.

    
05.01.2016 / 15:58