by marvoh » Thu Jun 11, 2009 10:16 am
thanks, had figured that out after a few searches on the internet. now i have an almost same dilema..
i have the following code which works fine on my localhost..
$connection = Propel::getConnection();
$query = "SELECT COUNT(*) AS count FROM stats WHERE license LIKE '".$param1."' AND MONTH(created_on) = '".$param2."'";
$statement = $connection->prepareStatement(sprintf($query, StatsPeer::TABLE_NAME));
$resultset = $statement->executeQuery();
$resultset->next();
return $resultset->getInt('count');
and evaluates to the following sql: SELECT COUNT(*) AS count FROM stats WHERE license LIKE 'LC1234' AND MONTH(created_on) = '6'
however, on the webserver, the query is a little different thus making it not run, here's the sql: SELECT COUNT(*) AS count FROM stats WHERE license LIKE 'LC1234' AND MONTH('stats.CREATED_ON') = '6'
where are these quotes ('stats.CREATED_ON') coming from..