View Single Post
  #6 (permalink)  
Old Oct 6th, 2007, 08:54
Rakuli's Avatar
Rakuli Rakuli is offline
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: convert date format

Okay, you could change this

PHP: Select all

// Create a MySQL table in the selected database       

$db="CREATE TABLE form (        title TEXT NOT NULL ,        date INT(16) NOT NULL,         subject VARCHAR(30) NOT NULL,         blog_mes TEXT NOT NULL ) "
That way when you insert your blog

PHP: Select all

 $sql="INSERT INTO form (title, date, subject, blog_mes)VALUES ('$title', " time() .", '$subject', '$blog_mes')"
This will insert a unix timestamp that you can compare easily with ASC DESC when selecting and also perform the myriad of date functions on with PHP