You can use the ereg function as well.
<?php
if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs)) {
echo "$regs[2]-$regs[3]-$regs[1]";
} else {
echo "Invalid date format: $date";
}
?>
Change the $date to the name of the variable queried from the DB. The $regs is the variable you are assigning to the ereg array, so you don't need to do anything with that.
This returns the date in the format of mm-dd-yyyy
Just change around the $regs numbers to fit your needs. In other words, 3,2,1 returns date in dd-mm-yyyy.