I have a large database that I need to convert time from normal date time format to unix timestamp.
Php is still new to me so I have been reading and am I on the right path? I have over 4000 entries now that need to be converted so I want to query the database and display the unix timestamps for each in a column
Here is my code although it isn't working correctly can someone help me please.
<?php
################################
## Database Connection Values ##
################################
$host = "localhost";
$dbuser = "xxxxxx";
$dbpass = "xxxxxxx";
$database = "xxxxxxxxxxx";
$db_connection = mysql_connect($host, $dbuser, $dbpass) or die(mysql_error());
$sql = "SELECT UNIX_TIMESTAMP(date)
FROM xxxxxxxxxxx";
$result = mysql_query($sql, $db_connection);
while($row = mysql_fetch_array($result)){
echo $result;
}
?>
Any help would be great
THANKS!