本文整理汇总了PHP中BD::consultar方法的典型用法代码示例。如果您正苦于以下问题:PHP BD::consultar方法的具体用法?PHP BD::consultar怎么用?PHP BD::consultar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BD
的用法示例。
在下文中一共展示了BD::consultar方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: selecionarProfessores
public function selecionarProfessores()
{
$bd = new BD();
return $bd->consultar("select * from pessoa where tipo = 'Professor' order by nome");
}
示例2: IN
$tbl = 'anuncios_inmobiliaria';
break;
default:
require_once "../GM_busquedas_motor.class.php";
break;
}
$id = $cat . ' IN(' . implode(',', $cat_hj) . ')';
switch ($_POST['blq']) {
case 'ce':
$sql = "SELECT titulo,id,precio," . $cat . ",localidad_id,provincia_id,latitud,longitud,\r\n\t\t\t\t\t(((acos(sin(('{$_SESSION['geoposicion']['latitud']}'*pi()/180)) * sin((latitud*pi()/180))+cos(('{$_SESSION['geoposicion']['latitud']}'*pi()/180)) * cos((latitud*pi()/180)) * cos((('{$_SESSION['geoposicion']['longitud']}' - longitud)*pi()/180))))*180/pi())*60*1.1515) AS distancia\r\n\t\t\t\t\tFROM " . $tbl . " WHERE " . $id . " ORDER BY distancia ASC LIMIT " . N_ADS;
break;
case 'au':
$sql = "SELECT titulo,id,precio," . $cat . ",localidad_id,provincia_id FROM " . $tbl . " WHERE " . $id . " ORDER BY fecha_creacion DESC LIMIT " . N_ADS;
break;
}
$result = BD::consultar($sql);
$str = '';
if ($opcion == 'lad') {
$str .= '
<div class="blqsug anunciosCerca ac">
<div class="selectsTop stac">
<div class="izTp">
<span href="#">Anuncios cerca de tí</span>
<select class="slTpIzq slac">
<option value="-2">Motor</option>
<option value="-3">Inmobiliaria</option>
<option>Trabajo</option>
<option>Etc.</option>
</select>
示例3: obtener_marca_sugerencia
function obtener_marca_sugerencia($keyword)
{
$data = array();
$sql = "SELECT nombre, nombre_rr, id, categorias FROM motor_marcas WHERE nombre LIKE '{$keyword}%' ORDER BY nombre ASC";
$result = BD::consultar($sql);
if ($result) {
while ($row = mysqli_fetch_assoc($result)) {
$data[] = $row;
}
mysqli_free_result($result);
return $data;
} else {
return 0;
}
}
示例4: selecionarIdTag
public function selecionarIdTag()
{
$bd = new BD();
return $bd->consultar("select id_tag from tags where nome_tag = '" . $this->getNomeTag() . "'");
}
示例5: selecionarTodos
public function selecionarTodos()
{
$bd = new BD();
return $bd->consultar("select s.*, p.nome from solicitacao s, pessoa p where s.id_professor = p.id_pessoa order by dia_saida");
}
示例6: BD
<?php
require_once '../classes/BD.class.php';
$bd = new BD();
//busca valor digitado no campo autocomplete "$_GET['term']
if (isset($_GET['term'])) {
$text = mysql_real_escape_string($_GET['term']);
$sql = "select * from tags where nome_tag like '%{$text}%'";
$result = $bd->consultar($sql);
$first = true;
$json = '[';
if ($result != 0 && is_array($result)) {
foreach ($result as $tags) {
if (!$first) {
$json .= ',';
} else {
$first = false;
}
$json .= '{"value":"' . utf8_encode($tags['nome_tag']) . '", "id":' . utf8_encode($tags['id_tag']) . '}';
}
// end foreach
$json .= ']';
echo $json;
}
}
示例7: getTagsbyID
public function getTagsbyID($id_artigo)
{
$bd = new BD();
$sql = "SELECT T.NOME_TAG FROM TAGS T, ARTIGOS_HAS_TAGS H WHERE H.ARTIGO_ID_ARTIGO = " . $id_artigo . " AND T.ID_TAG = H.TAGS_ID_TAG";
return $bd->consultar($sql);
}
示例8: existe
private static function existe($usuario)
{
$sql = "SELECT COUNT(*) FROM " . self::$tblUsuarios . " WHERE usuario='" . $usuario . "'";
$result = BD::consultar($sql);
if ($result) {
$row = mysqli_fetch_row($result);
mysqli_free_result($result);
return !empty($row[0]) ? $row[0] : 0;
} else {
return 0;
}
}
示例9: insertarMedida
public static function insertarMedida($param)
{
if ($param['temp_hum'] == "temp") {
$temp = $param['valor'];
$hum = "";
} elseif ($param['temp_hum'] == "hum") {
$hum = $param['valor'];
$temp = "";
}
if ($param['fecha'] == "" || empty($param['fecha'])) {
$param['fecha'] = "";
}
$sql = "INSERT INTO " . self::$tblMedidas . " SET temperatura='" . $temp . "', humedad='" . $hum . "', id_interfaz='" . $param['id'] . "', fecha='" . $param['fecha'] . "', vista='0'";
$result = BD::consultar($sql);
if ($result) {
echo $result;
return 1;
} else {
return 0;
}
}