Database parameter insertion error (with files that have the same code)

Asked

Viewed 41 times

0

Hello to those who are reading the question I would like to help with an Insert problem I am facing with a registration program I found on the internet and when making the first version it did not show any kind of error , but when copying this same code and only changing input names and adding some variables so that they were compatible with the new bank that was using I saw the message I put if it occurs-if an input error "The user cannot be added to the database" and I tried to find the error but the codes are practically the same but with names of different variables and additional fields and I did not succeed in finding the error and would like a different point of view to identify the error and if possible leave marked the line

for those who want to know where I got the code here is the video link with the original code thank you in advance :)

https://www.youtube.com/watch?v=FgSysHTsb6A&t=479s

php form code.

inserir a descrição da imagem aqui

code well.php

inserir a descrição da imagem aqui

inserting the parameters in the form form.php inserir a descrição da imagem aqui

insert into the form.php database without errors inserir a descrição da imagem aqui

result of inserting parameters in the seat inserir a descrição da imagem aqui

Form that is with the error

form2.php code (error form)

inserir a descrição da imagem aqui

bem2.php code (after the form2 insert the page would be redirected to bem2.php)

codigo bem.php together with the error that occurred after inserting in form2.php

inserir a descrição da imagem aqui

Form1 database: Account table: user

1 idIn(11) AUTO_INCREMENT

2 username varchar(100)
3 email varchar(100)
4 password varchar(100)
5 avatar varchar(100)

bank form2 bank: area table: test

1 patientIn(100) AUTO_INCREMENT
2 varchar name(100)
3 email varchar(100)
4 int(100 password)
5 Cpf varchar(100)
6 address varchar(100)
7 avatar varchar(100)

  • 1

    Arthur, good night, when you’re going to show us snippets of code for kindness instead of prints copy and paste the code here because it makes it easier to view!

1 answer

0

Arthur, good evening, notice that in your code you’re encrypting with MD5 your password, however in your bank, the 'password' column is int, if this encryption has letters it will never save, I believe that therefore in its functional example the password field was of type varchar.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.