Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need help with query coding


ancientmember

Recommended Posts

I'm trying to change this postpaid customer page and show only people who have outstanding balances. The current setting shows all the customer even if they don't owe anything. How do i filter the result as "show customers who have balance >$0" ?

 

Thanks for your help in advance!

 

 

 

$connectionstring = ConnectMainDatabase();

$Query = "SELECT Count(*) as rcount FROM customer ";

 

$queryexee = odbc_do($connectionstring, $Query);

if( odbc_fetch_row($queryexee) )

{

$rcount = odbc_result($queryexee, "rcount");

 

}

 

$tables = array();

$Query = "SELECT * FROM customer LIMIT $offset,100 ";

 

$rowcount=0;

$totaltime=0;

$queryexe = odbc_do($connectionstring, $Query);

$i=4;

while(odbc_fetch_row($queryexe))

{

$CustId = odbc_result($queryexe, "CustId");

$CustomerCode = odbc_result($queryexe, "CustomerCode");

$FirstName = odbc_result($queryexe, "FirstName");

$LastName = odbc_result($queryexe, "LastName");

$Address = odbc_result($queryexe, "Address");

$City = odbc_result($queryexe, "City");

$State = odbc_result($queryexe, "State");

$Country = odbc_result($queryexe, "Country");

$MaxCredit = odbc_result($queryexe, "MaxCredit");

$AccType = odbc_result($queryexe, "AccType");

$Balance = odbc_result($queryexe, "Balance");

$Active = odbc_result($queryexe, "Active");

 

 

$bold = "";

 

if($AccType==1)

$AccType="Prepaid Account";

else

$AccType="Postpaid Account";

 

// PRINT THE RESULTS

Create_Table_Row();

// Table_Cell("$bold$CustId");

Table_Cell("$bold$CustomerCode");

Table_Cell("$bold$FirstName $bold$LastName");

// Table_Cell("$bold$LastName");

Table_Cell("$bold$Address");

// Table_Cell("$bold$City");

// Table_Cell("$bold$State");

// Table_Cell("$bold$Country");

Table_Cell("$bold$MaxCredit");

Table_Cell("$bold$AccType");

Table_Cell("$bold$Balance");

// Table_Cell("$bold$Active");

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...