Saturday, July 30, 2011

Re: [phpXperts] mySQL Query with PHP variable is not working

 

Be sure that $from_date and $to_date are having date values in 'YYYY-MM-DD' format (if the column type is date)

Use '".$from_date."' instead of '$from_date'
$query=mysql_query("select SUM(payment) as totalPayment from msa_payment WHERE date BETWEEN '".$from_date."' AND '".$to_date."'");


Regards,

Md. Rafiqul Islam (Shohel)
GMG Airlines Ltd.
Cell: +880 1911745532



From: azhar <eng.azharul@gmail.com>
To: phpexperts@yahoogroups.com
Sent: Saturday, 30 July 2011 4:41 PM
Subject: [phpXperts] mySQL Query with PHP variable is not working

 
my query is not working. The Query is

$query=mysql_query("select SUM(payment) as totalPayment from msa_payment WHERE date BETWEEN '$from_date' AND '$to_date'");

Please help me.



__._,_.___
Recent Activity:
Visit phpXperts website at www.phpxperts.net
.

__,_._,___

No comments: