Monday, August 1, 2011

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

 

ok, this was my problem---

<?php
$from_date=$_POST['from_year']."-".$_POST['from_month']."-".$_POST['from_day'];
$to_date=$_POST['to_year']."-".$_POST['to_month']."-".$_POST['to_day'];

include('db_variable.php');

class total_summary{

var $total_payment;

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

echo $this->total_payment=$row['totalPayment'];

}
}

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

__,_._,___

No comments: