WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : How to correctly get timestamps and date fields from MySQL into PHP
Categories : PHP, MySQL, Databases Update Picture
Iraklis Mathiopoulos
Date : Mar 30th 2002
Grade : 1 of 5 (graded 1 times)
Viewed : 3118
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Iraklis Mathiopoulos
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

Read further if you are getting dates far away into the future (2033).

If you want to get a Timestamp (20020231164333 format) from a mysql
database and format it into a readable output, use this command on your
mySQL query,

assuming you have something like

SELECT lastaccesstime FROM user WHERE userid= 'hecky';

change it to

SELECT date_format(lastaccesstime, '%M %e, %Y') FROM user WHERE userid =
'hecky';

this will format the date to a Month, date year.

the % options should be the same as PHP ones, %M = month, %i = minutes, %Y
= year , etc.

As with PHP's date() function you customize the format.

eg

'Year is %Y, and month is %M'
=Year is 2002,and month is February

Hope this helped



bookmarker - PHP, PHPLIB, MySQL WWW based bookmark manager
Categories : MySQL, PHP, MySQL, Complete Programs, Databases
This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server.
Categories : Databases, MySQL, Complete Programs, PHP, Databases
Password reminder
Categories : PHP, PHP Classes, Databases, MySQL, Mail
Identify and log search engine access (spiders, robots, etc.) to a page.
Categories : HTTP, Environment Variables, PHP, MySQL, Databases
A simple script to count and report hits and the last modification time of an HTML page. Requires MySQL support (other DBs should work too, except possibly mSQL).
Categories : HTTP, MySQL, PHP, Databases
create a grid out of <INPUT TYPE=TEXT> then saving to a database. Uses a 'multi-dimension array', but not really as the array is just one big array with the index of "[$i][$j]". Have a look at the code and you'll see what I mean.
Categories : PHP, MySQL, Arrays, Databases
php-gtk mysql querying tool
Categories : PHP-GTK, MySQL, PHP, Databases
Simple conversion functions to change MySQL dates to arrays, arrays to MySQL dates.
Categories : PHP, Arrays, Date Time, Databases, MySQL
Specify your connection settings and create a link to a MySQL database.
Categories : PHP, PHP Classes, Databases, MySQL, Beginner Guides
dynamic table columns
Categories : PHP, HTML and PHP, Arrays, Databases, MySQL
mediaCat-GTK v2.0.0 - an mp3/cd/dvd cataloging utility written in php-gtk which interfaces with mysql and ms access (or db supported by PHP's Unified ODBC Functions)
Categories : PHP, MySQL, MS Access, Utilities, Databases
Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0
Categories : PHP, Sessions, Databases, MySQL
Pull Down Surfing - Surf on Change
Categories : Java Script, MySQL, HTML and PHP, PHP, Databases
Online Automatic Class Generator for MySQL Tables
Categories : PHP, PHP Classes, Classes and Objects, Databases, MySQL
Cut your MySQL Connections to 1 line of code
Categories : PHP, Beginner Guides, Databases, MySQL