After refining it a little bit more here is what I have:
PHP Code:
<?php include 'dbconnect.php';
$query = "SELECT TIMESTAMP('20130919220255')";
$test=mysqli_query($connect,$query);
$test1=mysqli_fetch_array($test, MYSQLI_NUM);
print $test1[0];
?>
TIMESTAMP converts the date string into the DATETIME format. Supposedly TIMESTAMP and DATETIME behave virtually the same if not exactly the same. The odd thing is that TIME, DATE, and TIMESTAMP work, but DATETIME does not. Any idea why this may be?
One more question. How can I create an array of TIMESTAMP values such as
PHP Code:
$query = "SELECT TIMESTAMP('20130919220255','20100919220251')";
or
PHP Code:
$query = "SELECT TIMESTAMP('20130919220255' AND '20100919220251')";
I can do this with php to generate several different queries, but I am wondering if this can be done with just one query.
Bookmarks