Since when has MySQL had a setting for "None" in the db for defaults?
I've never noticed that before. Is it going to treat it as truly nothing being there in PHP if that is set to None? Or am I going to have to go change all of my nones abck to empty strings?
Is "None" a way to try to prevent strict MySQL errors? I guess it would be ideal to have the installs cripts for my programs set defaults to None instead of '', but then again I haven;'t noticed this before so I assume only people with recent versions of MySQL even have that option.
Default None
Started by BASHERS33, Apr 01 2010 03:17 PM
6 replies to this topic
#1
Posted 01 April 2010 - 03:17 PM
|
|
|
#2
Posted 01 April 2010 - 04:08 PM
"None" would probably be a NULL.
#3
Posted 01 April 2010 - 04:17 PM
I don't know because NULL is another option in the dropdown (in phpmyadmin). You can set it as NULL or None so they must have some difference.
#4
Posted 11 April 2010 - 07:27 AM
Ah, none means that there is no default set for a field. that means that you need to specify it when you add a row. if you defaults it to null, it will be null if nothing is set.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
#5
Posted 11 April 2010 - 08:18 AM
yeah, but you can set it as "as defined" and then put nothing and it will show it as blank, but you can also choose "none" instead and instead of blank or null it says "none" (in phpmyadmin, anyway).
#6
Posted 11 April 2010 - 08:25 AM
there is a lot of difference between a blank value, a null value and the option none.
none mans that you don't set a default value.
null means that you enter to the database that there is no value
blank means that the value is ""
it's of significance to learn the differences!
none mans that you don't set a default value.
null means that you enter to the database that there is no value
blank means that the value is ""
it's of significance to learn the differences!
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
#7
Posted 11 April 2010 - 08:52 AM
Well I've asked before if doing a default of "" would treat it as a default despite it being nothing and nobody seemed to know.
The script I have which creates the tables says default '' but yet when I looked in the DB it had them alls et to none instead of "".
If default is "" would that prevent errors if someone uses mysql strict? If yes then I would much rather have default "" than to have default none. But like I said... the script specifies default '' and yet all these rows say none in the DB. It's modifications for Invision's forum software so it's using their setup for adding apps. I'm not sure why it says none in the DB because in the past the tables properly installed as ''.
The script I have which creates the tables says default '' but yet when I looked in the DB it had them alls et to none instead of "".
If default is "" would that prevent errors if someone uses mysql strict? If yes then I would much rather have default "" than to have default none. But like I said... the script specifies default '' and yet all these rows say none in the DB. It's modifications for Invision's forum software so it's using their setup for adding apps. I'm not sure why it says none in the DB because in the past the tables properly installed as ''.


Sign In
Create Account


Back to top









