This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Quando for trocar o modo de Fetch, salve a configuração antiga para restaurar depois. | |
// Não tem como garantir que ela estará configurada como ADODB_FETCH_NUM. | |
$old_fetch_mode = $this->Db->SetFetchMode(ADODB_FETCH_ASSOC); | |
// O getArray que você usou seria +/- isso | |
$ar = $this->Db->getAll("SELECT * FROM ACT"); | |
# Abaixo é um exemplo de insert, compatível para fire e oracle. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PDO_DataAccess | |
{ | |
/** | |
* Database connection link | |
* @var \PDO | |
*/ | |
protected $link; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// A função abaixo demonstra o uso de uma expressão regular que identifica, de forma simples, telefones válidos no Brasil. | |
// Nenhum DDD iniciado por 0 é aceito, e nenhum número de telefone pode iniciar com 0 ou 1. | |
// Exemplos válidos: +55 (11) 98888-8888 / 9999-9999 / 21 98888-8888 / 5511988888888 | |
function phoneValidate($phone) | |
{ | |
$regex = '/^(?:(?:\+|00)?(55)\s?)?(?:\(?([1-9][0-9])\)?\s?)?(?:((?:9\d|[2-9])\d{3})\-?(\d{4}))$/'; | |
if (preg_match($regex, $phone) == false) { |