本文整理汇总了PHP中Querys::query方法的典型用法代码示例。如果您正苦于以下问题:PHP Querys::query方法的具体用法?PHP Querys::query怎么用?PHP Querys::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Querys
的用法示例。
在下文中一共展示了Querys::query方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loginUser
/**
* Metodo loginUser
*
* @access public
* @param string $login
* @param string $senha
* @return booleam
*/
public function loginUser($login, $senha)
{
$db = new Querys();
// Verifica se usuario está logado, caso contrario verifica aluno.
$usuario_query = $db->query("SELECT \n\t\t\t\t\t\t\t\t\t\t\t* \n\t\t\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\tgsia_accounts\n\t\t\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\t\tact_account_email = '" . $db->escape($login) . "' AND \n\t\t\t\t\t\t\t\t\t\t\tact_account_senha = '" . $db->escape(md5($senha)) . "'");
if ($usuario_query->num_rows) {
$this->act_accounts_id = $usuario_query->row['act_accounts_id'];
$this->act_account_email = $usuario_query->row['act_account_email'];
$this->act_account_cpf = $usuario_query->row['act_account_cpf'];
$this->act_account_nome = $usuario_query->row['act_account_nome'];
$this->act_account_senha = $usuario_query->row['act_account_senha'];
$session = new Session();
$session->StartSession();
$session->data['user']['act_accounts_id'] = $this->act_accounts_id;
$session->data['user']['user_login'] = $this->act_account_email;
$session->data['user']['user_cpf'] = $this->act_account_cpf;
$session->data['user']['user_name'] = $this->act_account_nome;
$session->data['user']['act_account_senha'] = $this->act_account_senha;
return true;
} else {
return false;
}
}
示例2: getCampos
/**
* Metodo getCampos
*
* @access public
* @return array
*/
public function getCampos()
{
$querys = new Querys();
$sql = "SELECT * FROM " . $this->tabela;
$result = $querys->query($sql);
return $result->fields;
}