Have I lost data from my database indefinetly?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

Have I lost data from my database indefinetly?

Post by impulse() »

I stumbled across an old website log system I wrote a couple of months back when I was cleaning up old code and I noticed a field type in MySQL was set to 'Text' for a date entry. Immediatly I changed this to a 'Date' type and it set ALL current entries in the table to '00-00-0000'. But when I changed it back to 'Text' it still remained. Have I lost the original data indefinetly or is there a way to recover it?

Regards,
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

I doubt you will be able to, as the data that was contained in those fields has been converted... once you intval("40404.4040404") = 40404, you wont be able to floatval(40404) = 40404.4040404
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

Post by impulse() »

I hope the following word to express myself isn't banned:


Bugger.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Does your mysql server by any chance keep a binary log? see http://dev.mysql.com/doc/internals/en/r ... y-log.html

Now is the perfect time to develop and establish a backup plan.
Post Reply