My first code was working fine. It is MySQL 5.x installed on my machine. I used STR_TO_DATE() then uploaded my files, found out that the server has the version 3.x.x which doesn't support the function I used. Spending 6 hours today I found SUBSTRING_INDEX() function and how to convert a date from MM-DD-YYYY to YYYY-MM-DD format. From the command line everything works fine. I've tested the function but couldn't use it with PHP. I wrote a code to test the function with PHP and I am stuck, I don't know what I am doing wrong. I copied the code below. If there is any other way that I could convert the date format, can you tell me about that? I appreciate any help. Thank you and here is the code used to test the function. Page doesn't give any error messages, nothing, just a blank white page is all it displayed. [code] mysql_connect($hostname,$username,$password); mysql_select_db($database) or die(mysql_error()); #$fdate='12-31-2006'; #echo $fdate; $query="SUBSTRING_INDEX('12-31-2006','-',-1)"; $result = mysql_query($query); echo $result; [/code]