本文整理汇总了PHP中database::executeQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP database::executeQuery方法的具体用法?PHP database::executeQuery怎么用?PHP database::executeQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类database
的用法示例。
在下文中一共展示了database::executeQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: makeLanguageBar
public function makeLanguageBar($arr, $divider = " | ")
{
// make a new connection to the database
$database = new database($arr);
$result = $database->executeQuery("SELECT * FROM languages");
if ($result) {
$type = null;
switch ($this->languageType) {
case 0:
default:
$type = "short";
break;
case 1:
$type = "long";
break;
case 2:
$type = "flag";
break;
}
for ($i = 1; $i <= count($result); ++$i) {
$url = getNewUrl('l', $i);
if ($i == $this->language) {
echo "<strong><a href=\"" . $url . "\">" . $result[$i - 1][$type] . "</a></strong>";
} else {
echo "<a href=\"" . $url . "\">" . $result[$i - 1][$type] . "</a>";
}
if ($i < count($result)) {
echo $divider;
}
}
} else {
// make a new connection
echo "There is a problem with the connection with the database, try again later.<br />";
}
}
示例2: GuardarPeriodosSeguimiento
function GuardarPeriodosSeguimiento()
{
$fecha = date("Y-m-d H:i:s");
$usuario = $_SESSION['session']['user'];
$plano = $this->idplan;
$sql = "SELECT * FROM PL_POPERATIVOS_PERIODOS WHERE PK_POPERATIVO = '{$plano}'";
$numperiodosbase = database::getNumRows($sql);
$numperiodos = sizeof($this->seguimiento) - 1;
if ($numperiodosbase > $numperiodos) {
for ($i = $numperiodos; $i <= $numperiodosbase; $i++) {
$sql = "DELETE FROM PL_POPERATIVOS_PERIODOS WHERE PK_POPERATIVO = '{$plano}' AND ORDEN='{$i}'";
database::executeQuery($sql);
}
}
$cont = 1;
for ($i = 0; $i < sizeof($this->seguimiento) - 1; $i++) {
$periodo = explode("^", $this->seguimiento[$i]);
$titulo = $periodo[0];
$fechai = $periodo[1];
$fechat = $periodo[2];
$sql = "SELECT * FROM PL_POPERATIVOS_PERIODOS WHERE PK_POPERATIVO = '{$plano}' AND ORDEN = '{$cont}'";
$row = database::getRow($sql);
if ($row) {
$this->campos = array('PERIODO' => $titulo, 'FECHA_I' => $fechai, 'FECHA_T' => $fechat, 'FECHA_M' => $fecha, 'PK_USUARIO' => $_SESSION['session']['user']);
$condition = "PK_POPERATIVO = '{$plano}' AND ORDEN = '{$cont}'";
database::updateRecords("PL_POPERATIVOS_PERIODOS", $this->campos, $condition);
} else {
$idperiodo = strtoupper(substr(uniqid('SP'), 0, 15));
$this->campos = array('PK1' => $idperiodo, 'PERIODO' => $periodo[0], 'ORDEN' => $cont, 'FECHA_I' => $periodo[1], 'FECHA_T' => $periodo[2], 'PK_POPERATIVO' => $this->idplan, 'FECHA_R' => date("Y-m-d H:i:s"), 'FECHA_M' => NULL, 'PK_USUARIO' => $_SESSION['session']['user']);
database::insertRecords("PL_POPERATIVOS_PERIODOS", $this->campos);
}
$cont++;
}
}
示例3: Eliminar
function Eliminar()
{
foreach ($this->ids as $id) {
$sql = "DELETE FROM RESPONSABLES_CENTRO WHERE PK1 = '{$id}' ";
$result = database::executeQuery($sql);
}
}
示例4: Eliminar
function Eliminar()
{
foreach ($this->ids as $id) {
$sql = "DELETE FROM PL_POPERATIVOS_ASIGNACIONES WHERE PK1 = '{$id}' ";
$result = database::executeQuery($sql);
}
}
示例5: ObtenerJerarquias
function ObtenerJerarquias($id)
{
$sql = "SELECT * FROM JERARQUIAS WHERE PADRE = '{$id}' ORDER BY ORDEN";
$result = database::executeQuery($sql);
while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
$this->niveles[] = $row;
}
}
示例6: obtenerRoles
function obtenerRoles()
{
$sql = "SELECT * FROM ROLES WHERE TIPO IN('P') ";
$result = database::executeQuery($sql);
while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
$this->roles[] = $row;
}
}
示例7: getObjetivosPlan
function getObjetivosPlan($idlinea)
{
$this->objetivos = array();
$sql = "SELECT * FROM PL_PESTRATEGICOS_OBJETIVOSE WHERE PK_LESTRATEGICA = '{$idlinea}' ORDER BY ORDEN";
$result = database::executeQuery($sql);
while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
$this->objetivos[] = $row;
}
}
示例8: getComentarios
function getComentarios($id)
{
$this->comentarios = array();
$sql = "SELECT * FROM APOYOS_COMENTARIOS WHERE PK_APOYO = '{$id}' ORDER BY FECHA_R DESC";
$result = database::executeQuery($sql);
while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
$this->comentarios[] = $row;
}
}
示例9: getMensajes
function getMensajes()
{
$usuario = $_SESSION['session']['user'];
$this->mensajes = array();
$sql = sprintf("SELECT * FROM NOTIFICACIONES WHERE TIPO = 'ALERT' AND PK_USUARIO = '{$usuario}' ORDER BY FECHA_R");
$result = database::executeQuery($sql);
while ($r = mssql_fetch_array($result, MSSQL_ASSOC)) {
}
}
示例10: AgregarNiveles
function AgregarNiveles()
{
$usuario = $this->usuario;
$sql = "DELETE USUARIOS_JERARQUIA WHERE PK_USUARIO = '{$usuario}'";
database::executeQuery($sql);
foreach ($this->niveles as $row) {
$this->campos = array('PK_USUARIO' => $this->usuario, 'PK_JERARQUIA' => $row);
database::insertRecords("USUARIOS_JERARQUIA", $this->campos);
}
}
示例11: eliminarMedios
function eliminarMedios($id)
{
$sql = "DELETE FROM PL_POPERATIVOS_MEDIOS WHERE PK_OTACTICO = '{$id}' ";
$result = database::executeQuery($sql);
if ($result) {
//$this->EliminarEvidencias($PK_PLAN);
} else {
return FALSE;
}
}
示例12: Eliminar
function Eliminar($id)
{
$sql = "DELETE FROM FICHAS WHERE PK1 = '{$id}' ";
$result = database::executeQuery($sql);
if ($result) {
return TRUE;
} else {
return FALSE;
}
}
示例13: Eliminar
function Eliminar($id)
{
$sql = "DELETE FROM PROYECTOS WHERE PK1 = '{$id}'";
$result = database::executeQuery($sql, $params);
if ($result) {
//if($this->EliminarRolesUsuario($id)){return TRUE;}else{return FALSE;}
} else {
return FALSE;
}
}
示例14: EliminarRolesPermisos
function EliminarRolesPermisos($id)
{
$sql = "DELETE FROM ROLES_PERMISOS WHERE PK_ROL = '{$id}' ";
$result = database::executeQuery($sql);
if ($result) {
return TRUE;
} else {
return FALSE;
}
}
示例15: getLinks
function getLinks()
{
$this->links = array();
$sql = "SELECT * FROM LINKS";
$objdb = new database();
$result = $objdb->executeQuery($sql);
while ($row = mysql_fetch_array($result)) {
$this->links[] = $row;
}
}