Date? String? Pulling my hair out here! Help!
I'm developing something at the moment which uses phpgrid to show data from a MySQL database depending on what is selected, etc, etc.
I'm setting the variable, like this as its being set from a form...
And the MySQL Query string is being set as follows...:
$selecteddate = $_POST['dbDate'];
This shows no results within the phpgrid element. However, if I change the variable to:
select_command = "SELECT * FROM tbldetentions WHERE DateSetFor = '". $selecteddate ."'";
$selecteddate = date("Y-m-d");
Then it works! I've even put this is the query string itself just to confirm it works...
$selecteddate = "2013-05-30";
I can echo this variable and it shows it as whatever the date has been set to, eg: 2013-05-30 but it just won't play ball. What am I missing here?
select_command = "SELECT * FROM tbldetentions WHERE DateSetFor = '2013-05-30'";