-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set default value for Not Null Column in CRE.sql #3
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR! This seems weird. CRE.sql has ALTER TABLE `candidates`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; and then the insert code in $query = mysqli_prepare($DB, "INSERT INTO `candidates` (name) VALUES (?)");
mysqli_stmt_bind_param($query, 's', $_POST["candidate_name"]); We only set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, so it does default to 0. Thanks @hharchani.
@revsi, can you please update the commit message to match convention? Capital first letter, imperative tense of writing, etc.? Also, since @hharchani says it implicitly defaults to 0, maybe you can explicitly say: "Set default value of some fields in CRE.sql" or something like that?
Yeah, it defaults to 0, but better to be explicit |
I am not sure exactly. But for MySql V5.7, If strict SQL mode is enabled, an error occurs for transactional tables and the statement is rolled back in case of Not Null Column. In my case it was causing error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. That's interesting. It's certainly better to be explicit then. Will merge this after the commit message change. :)
Sorry, you changed the PR title but not the commit itself. Could you please git commit --amend
and update the commit message too?
No description provided.