Location: PHPKode > scripts > LQueryBU > LQueryBU/query_units/examples/units/getCities.php
====QUERY====
SELECT SQL_CALC_FOUND_ROWS * FROM City
WHERE $RECORD->WHERE 
ORDER BY [ORDER_BY] $ASCDESC
LIMIT [LIMIT_FROM],[LIMIT_TO]

====PRE_FORMAT_FIELDS====
<?php 
// Before to eval QUERY, you can check or assign here any variable

if ($RECORD->LIMIT_FROM < 0)
	$RECORD->LIMIT_FROM = 0;

if (!isset($RECORD->WHERE))
	$RECORD->WHERE = "1=1";
	
	if ($RECORD->ASCDESC == 1)
	    $ASCDESC = "ASC";
	else
	    $ASCDESC = "DESC";
?>
====POST_FORMAT_FIELDS====
<?php
// This function example converts country name in friendly url name
// Yo can add here any post action to be executed for all records

//$RECORD->Country_url = $this->getDataQuery("/examples/functions/examplef1",array("TXT_TO_CONVERT_TO_URL"=>'"'.$RECORD->Name));
?>
====POST_FORMAT_FIELDS_NO_RECORDS_FOUND====
<?php 

?>
====POST_SQL_COMMANDS_OK====
PHP: <?php ?>
SQL
====POST_SQL_COMMANDS_KO====
PHP: <?php ?>
SQL:
====POST_SQL_COMMANDS_NO_RECORDS_FOUND====
PHP: <?php ?>
SQL:

====AUTOFMT====
{"FIELD":"ID",				"TITLE":"Codigo",														"OPTIONS":"searchexact,order,editable,ID","SIZEW":"60"}
{"FIELD":"Name",			"TITLE":"Nombre",														"OPTIONS":"search,order","SIZEW":"300"}
{"FIELD":"CountryCode",		"TITLE":"Cod.Pais",								"ALIGN":"center",		"OPTIONS":"search,order","SIZEW":"80"}
{"FIELD":"District",		"TITLE":"Distrito",														"OPTIONS":"search,order","SIZEW":"180"}
{"FIELD":"Population",		"TITLE":"Poblacion",	"FORMAT":"0|,|.||",			"OPTIONS":"search.order","SIZEW":"110"}
{"FIELD":"DEFAULT",			"TITLE":"Nombre",														"OPTIONS":"search,order","SIZEW":"150"}
Return current item: LQueryBU