I want to know how do get the results from this query
mysql> SELECT PERIOD_DIFF(20010101,20010110) as days;
to a variable in my php script
I am have no problems connecting to my database or query tables in my database but i don't know how to the the results of this query to a variable in my script.
This is what I have so far:
$sql = "SELECT PERIOD_DIFF(20010101,20010110) as days";
//This is where I am stuck
$diff_days = //result from mysql query