1.11M Members

unable to fetch value from database.

 
0
 

I am fetching data from mysql database and using it.but one column 'added_on's value is not fetching other row values of corresponding to 'added_on' value is previewing correctly.i am using it simply echo $vrow['added_on']; .

 
0
 

And the PHP code that you are trying to retrieve a DB rs ?

 
0
 

the code is

$date1=$_POST['from'];
         $date2=$_POST['to'];
         $vquery="SELECT * FROM rt_transaction WHERE added_on>=Unix_Timestamp(".$date1.") AND added_on<=Unix_Timestamp(".$date2.") AND rt_owner_id='".$_POST['owner']."'";
         $vresult=mysql_query($vquery) or die(mysql_error());


        $dataList=array();
        while ($vrow=mysql_fetch_assoc($vresult))
             { 
        $wquery="SELECT rt_user_name FROM rt_user WHERE rt_user_id='".$vrow['rt_owner_id']."'";
        $wresult=mysql_query($wquery) or die(mysql_error());
        while($wrow=mysql_fetch_assoc($wresult))
              {
                 $txnunit=$wrow['rt_user_name'];
              }  

        IF($vrow['rt_txn_type']=='C')
           {
             $income=$vrow['rt_txn_amount'];
             $spend=0;
             $balance=$vrow['rt_txn_amount'];
           }
         else
          {
             $income=0;
             $spend=$vrow['rt_txn_amount'];
             $balance="-".$vrow['rt_txn_amount'];
          }
        $dataList[]=array(
                                //$rtTransaction->getRtTxnId(),
                                date("Y-m-d",$vrow['added_on']),
                                $txnunit,
                                $vrow['rt_txn_desc'],
                                $income,
                                $spend,
                                $balance
                            );
        }

        $pdf = new PDF();
        $pdf->setDataList($dataList);
        $pdf->setHeaderList($headerList);
        $pdf->setColumnWidthList($columnWidthList);
        $pdf->SetFont('Arial','',9);
        $pdf->SetRightMargin(5);
        $pdf->AddPage();
        $pdf->generateBasicTable();
        $pdf->Output();   
        }
 
0
 

the problem the added_on column is used on 31st line.can any body help me?

 
0
 

i think problem is in your query check it you put wrong symbol may be

Question Answered as of 1 Year Ago by jkon and AARTI SHRIVAS
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article