MySQL Category

Get the table’s information in mysql

Friday, January 9th, 2009 at 15:25:18
0

Sometimes we need information like the next auto increment value or the total number of records from a table present in our database.

Here is a way to access that information very quickly:

SHOW TABLE STATUS LIKE 'table-name'

MySQL date formatting

Monday, December 29th, 2008 at 17:06:43
0

Often it’s much easier to get an already formatted date directly from the MySQL query than trying to format in php a standard result from a DATETIME field. You can do this by using the DATE_FORMAT (date, format) function in your query.

Let’s assume that we have the table dates with the DATETIME field SomeDate that has the value 2008-12-29 17:30:10