$query = mysql_query(
    "SELECT SUM( usd_amount ) AS value_sum 
     FROM order_tbl 
     WHERE o_date BETWEEN SUBDATE( CURDATE( ) , 
          DAYOFMONTH( CURDATE( ) ) -1 ) AND CURDATE()
");
if(!$query){
        echo "Did Not Execute the query";
        echo mysqli_error();
}
I keep getting the "Did Not Execute the query" but the query runs fine in phpMyAdmin. The echo for mysqli_error() is also not displaying anything.
Also, I have checked the connection and the connection works absolutely correct.
 
     
     
     
     
    