KevinM1 Posted October 31, 2006 Share Posted October 31, 2006 When defining a table, does the order of column attributes matter? If so, is there a general syntax that column attrubutes follow (i.e. datatype, followed by it being null or not, followed by...)? Quote Link to comment https://forums.phpfreaks.com/topic/25713-stupid-question/ Share on other sites More sharing options...
obsidian Posted October 31, 2006 Share Posted October 31, 2006 The order of your declared columns really only matters to you. Keep in mind that whatever order you create your columns in is going to be the default order of values for INSERT statements as well. With this in mind, order doesn't necessarily matter as long as you keep track of what order to insert you values. Quote Link to comment https://forums.phpfreaks.com/topic/25713-stupid-question/#findComment-117355 Share on other sites More sharing options...
KevinM1 Posted October 31, 2006 Author Share Posted October 31, 2006 [quote author=obsidian link=topic=113366.msg460601#msg460601 date=1162311235]The order of your declared columns really only matters to you. Keep in mind that whatever order you create your columns in is going to be the default order of values for INSERT statements as well. With this in mind, order doesn't necessarily matter as long as you keep track of what order to insert you values.[/quote]Ah, I should've phrased my initial question better... ;DI'm wondering about the [i]attributes[/i] (like auto_increment, not null, etc) -- is there a certain order they're supposed to go in after the column name and datatype have been declared? Quote Link to comment https://forums.phpfreaks.com/topic/25713-stupid-question/#findComment-117367 Share on other sites More sharing options...
obsidian Posted October 31, 2006 Share Posted October 31, 2006 [quote author=Nightslyr link=topic=113366.msg460613#msg460613 date=1162311969]I'm wondering about the [i]attributes[/i] (like auto_increment, not null, etc) -- is there a certain order they're supposed to go in after the column name and datatype have been declared?[/quote]Not that I know of. I'll leave the precision of this answer up to fenway, though ;) Quote Link to comment https://forums.phpfreaks.com/topic/25713-stupid-question/#findComment-117370 Share on other sites More sharing options...
fenway Posted October 31, 2006 Share Posted October 31, 2006 There is for the CREATE TABLE syntax... usually fieldName, datatype, datatype_options (e.g. unsigned, not null), default. Quote Link to comment https://forums.phpfreaks.com/topic/25713-stupid-question/#findComment-117492 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.