本文整理汇总了PHP中SQL::seleccionar方法的典型用法代码示例。如果您正苦于以下问题:PHP SQL::seleccionar方法的具体用法?PHP SQL::seleccionar怎么用?PHP SQL::seleccionar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQL
的用法示例。
在下文中一共展示了SQL::seleccionar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
include "include/incluir.php";
//$titulo = SQL::filasEnArreglo(SQL::seleccionar("trcPriNombre","bif_terceros"));
$menu = SQL::filasEnArreglo(SQL::seleccionar("mnsId, mnsDescripcion, mnsRuta", "bif_menus", "mnsPadre = 0"));
$css = CSS::estiloHTML();
$js = "";
echo HTML::esquemaHTML(HTML::head($css, $js, "Fila") . HTML::body(HTML::header(HTML::figure("imagenes/logo.jpg") . HTML::nav(HTML::menuPrincipal($menu, 'navbar-nav'))) . HTML::section(HTML::article("") . HTML::aside("")) . HTML::footer("") . HTML::popUp("") . HTML::alert("") . HTML::menuBotones()));
示例2: tablaDinamica
public function tablaDinamica($campos = "'mnsId', 'mnsPadre'", $tabla = "bif_menus", $condicion = "1=1")
{
$registros = SQL::filasEnArreglo(SQL::seleccionar("COLUMN_NAME, NUMERIC_PRECISION, CHARACTER_MAXIMUM_LENGTH", "INFORMATION_SCHEMA.COLUMNS", "COLUMN_NAME IN (" . $campos . ")"));
$codigo = "\n <script>\n \$(document).ready(function(){\n \n \$('.flexme3').flexigrid({\n url : 'include/obtenerTabla.php',\n dataType : 'json',\n colModel : [ ";
foreach ($registros as $clave => $valor) {
$cabecera = self::idiomaTexto($valor[0]);
$lenCabecera = strlen($cabecera);
if (!empty($valor[1])) {
$lenColumna = $valor[1];
} else {
$lenColumna = $valor[2];
}
if ($lenCabecera > $lenColumna) {
$lenCampo = $lenCabecera * 10;
} else {
$lenCampo = $lenColumna - 100;
}
$codigo .= "{ \n display : '" . $cabecera . "'\n , name : '" . $valor[0] . "'\n , width : 200\n , sortable : true,\n align : 'center'\n },";
}
$codigo = substr($codigo, 0, strlen($codigo) - 1);
$codigo .= " ],\n \n sortname : '" . $registros[0][0] . "',\n title : 'Menus',\n query : '" . str_replace("'", "", $campos) . "/" . $tabla . "/" . $condicion . "', \n sortorder : 'asc',\n usepager : true,\n useRp : true,\n rp : 10,\n showTableToggleBtn : true,\n width : 'auto',\n height : 'auto',\n pagestat: '{from} de {to}, Total: {total} registros',\n pagetext: 'Pagina',\n outof: 'de',\n dblClickResize: true, \n onDoubleClick: true,\n singleSelect : true\n }); \n \n });\n </script>\n\n <table class='flexme3' style='display: none'></table>\n ";
return $codigo;
}
示例3: isset
<?php
include "incluir.php";
$page = isset($_POST['page']) ? $_POST['page'] : 1;
$rp = isset($_POST['rp']) ? $_POST['rp'] : 10;
$sortname = isset($_POST['sortname']) ? $_POST['sortname'] : 'mnsId';
$sortorder = isset($_POST['sortorder']) ? $_POST['sortorder'] : 'desc';
$query = isset($_POST['query']) ? $_POST['query'] : "mnsId, mnsPadre/bif_menus/1=1";
$qtype = isset($_POST['qtype']) ? $_POST['qtype'] : false;
$arreglo = explode("/", $query);
$primerCampo = explode(",", $arreglo[0]);
$sort = "{$sortname} {$sortorder}";
$limit = ($page - 1) * $rp . ", {$rp}";
$rows = SQL::filasEnArreglo1(SQL::seleccionar($arreglo[0], $arreglo[1], $arreglo[2], "", $sort, $limit));
$total = SQL::filasEnArreglo(SQL::seleccionar("COUNT(" . $primerCampo[0] . ")", $arreglo[1], $arreglo[2]));
header("Content-type: application/json");
$jsonData = array('page' => $page, 'total' => $total[0][0], 'rows' => array());
foreach ($rows as $clave => $valor) {
$entry = array(key($valor) => $valor[key($valor)], 'cell' => $rows[$clave]);
$jsonData['rows'][] = $entry;
}
echo json_encode($jsonData);