This file contains 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
select woeid from geo.places where text="brasília, df, brazil" |
This file contains 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 | |
$this->getUser()->shutdown(); |
This file contains 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 | |
$qs = Doctrine_Query::create() | |
->from('MyTable1 m') | |
->leftJoin('m.MyTable2 p'); | |
$res = $qs->execute(); | |
$qs->free(); |
This file contains 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
decode(trim(col),NULL,NULL,col) is NULL | |
-- http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements005.htm | |
-- Do not use null to represent a value of zero, because they are not equivalent. | |
-- Note: Oracle Database currently treats a character value with a length of zero as null. | |
-- However, this may not continue to be true in future releases, and Oracle recommends that | |
-- you do not treat empty strings the same as nulls. |
This file contains 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
SELECT TABLE_NAME FROM USER_TAB_COLUMNS | |
WHERE COLUMN_NAME = 'ID' |
This file contains 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 | |
$str = '13++56-461.79/27--14-abc'; | |
$filter = filter_var($str,FILTER_SANITIZE_NUMBER_INT); | |
$onlyDigitsFilterVar = str_replace(array('+', '-'), '', $filter); | |
$onlyDigitsRegexp1 = preg_replace('/[^\d]/', '', $str); | |
$onlyDigitsRegexp2 = preg_replace('/[^[:digit:]]/', '', $str); // http://www.php.net/manual/en/regexp.reference.character-classes.php | |
var_dump($filter); // string(19) "13++56-4617927--14-" |
This file contains 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 TimeoutException extends RuntimeException {} | |
class Timeout | |
{ | |
private $active; | |
public function set($seconds) | |
{ |
This file contains 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
tr:nth-child(2n+1){ background: #fff } | |
tr:nth-child(2n+0){ background: #ffffec } |
This file contains 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
NLS_LANG <lang> - character set, language and territory | |
TNS_ADMIN <path> - path to tnsnames.ora file | |
PATH <path> - add location of the Oracle client |
This file contains 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 | |
$q = Doctrine_Query::create() | |
->select('a.title as title') | |
->from('Article a') | |
->where('a.id = ?', $this->getId()); | |
->fetchOne()->title; |