Saturday, March 8, 2014

Tute 30 : Show publishing Date and time in article : Part One

Now we will show publishing date and time in our article. So we work two stapes. First stapes work in database and 2nd stapes work about php code.


First stapes :
We go to phpmyadmin tabe in google Chrome or take a new tab and write " localhost/phpmyadmin " (without cote). Then click our database "tutedb". After that click "tute" table in left side. Then we see our all post in right side.
Then click "structure" in top tab. We see id, heading, details... etc. This is tute table structure. Now we take a new column. In bottom side we see add line. In text field write 1 and select " At End of Table" chack box then click "Go".



Now we see some blank field. Previously we fill up this from. But now will be some change. In filed we write "published time". In type we scrall down and select "TimeStamp". In Default select "Current_timestamps" and in " Attributes" select "on update current timestamp" then click save.



In last line see a new row is created. Now we insert a new article. In we article we write "heading", "details", "image" and "category". But time will not select. Then click go button. We see in our database last article show current time in last column.


Our database work is finished. Now we work about php code in index.php file.

No comments :

Post a Comment