Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

blobs and timestamps

Status
Not open for further replies.

tranquillo

Technical User
Jan 6, 2003
22
SE
Hi...
I'm using php and MySQL to do a website, and for the news section I'd like to know the best way to make a timestamp in the database... is there some kind of function in MySQL I can use that automaticly adds the current date/time? (I'm not using UNIX if that matters).
and I'd like to know how I insert a file (.jpg) into the database. how does that sql query look?

thanks...
 
If you have a table with a column type of "timestamp", MySQL will automatically update that column to the current date/time stamp when rows are inserted or updated.

Instead of dumping the actual JPEG into the database, I recommend just storing its filename in the database, and storing the actual file on the filesystem.

Want the best answers? Ask the best questions: TANSTAAFL!
 
thanks... ;)

do you know how to make the timestamp look good when printed on the php page?
now I use this "SELECT datum, date_format(datum, '%Y %M %D') as date" to get the date in order and it looks like this: 2003 March 19th.
but I'd like it to be 03 instead of 2003...

thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top