08-22-2017, 11:08 AM
I just use phpmyadmin. Here are a few tips:
The first column is always called id, int(11) auto increment, primary key.
Use date when you need to do math on the data and then create your date with date("Y-m-d") in php
Don't use int unless you absolutely need it to be an integer. Varchar is fine 99{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d} of the time and will save you a bunch of headaches.
Making your columns only accept small numbers doesn't save you much in the way of space and performance. You can always tweak later, but making something varchar255 is not going to kill your db, but if you make it 10 and you need 11, your query will fail, so go big to start.
Know that 4.3 is getting some additional debugging tools for the db to give you more clarity as to why something failed.
The first column is always called id, int(11) auto increment, primary key.
Use date when you need to do math on the data and then create your date with date("Y-m-d") in php
Don't use int unless you absolutely need it to be an integer. Varchar is fine 99{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d} of the time and will save you a bunch of headaches.
Making your columns only accept small numbers doesn't save you much in the way of space and performance. You can always tweak later, but making something varchar255 is not going to kill your db, but if you make it 10 and you need 11, your query will fail, so go big to start.
Know that 4.3 is getting some additional debugging tools for the db to give you more clarity as to why something failed.