SQL CASE WHEN STATEMENt into PHP VARIABLE -


i have problem:

i have sql statement:

select amount cicmpy    inner join (select dealercode, sum(amount) amount      (select dealercode, log logtlimit,temporarycreditlimit temporarycreditlimit,             case when  temporarycreditlimit>0 temporarycreditlimit else log end amount              log_data status = 1 group dealercode) x     on x.dealercode=debcode debnr not null , ltrim(debcode) = '21021287'` 

and want statement php $query variable.

try this,it solve error.

$sql = "put query";    //put query in php variable $result = mysql_query($sql) or die(mysql_error()); while($row=mysql_fetch_array($result)) { stuff... } 

for more reference


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -