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']; .

Recommended Answers

All 4 Replies

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

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();   
        }

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.