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
require_once(BASEPATH.'database/DB_driver.php'); | |
if ( ! isset($active_record) OR $active_record == TRUE) | |
{ | |
require_once(BASEPATH.'database/DB_active_rec'.EXT); | |
// get the CI instance | |
$CI = & get_instance(); | |
$prefix = $CI->config->item('subclass_prefix'); |
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
INSERT INTO | |
`product` | |
SET | |
`id`=? | |
,`name`=? | |
,`created_at`=NOW() | |
ON DUPLICATE KEY UPDATE | |
,`name`=? | |
'; | |
$stmt = mysqli_prepare($dbh, $sql); |
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
$exists = $this->db->select(‘id’)->where(‘id’, $id)->get()->row_array(); | |
if($exists) | |
{ | |
$this->some_model->add($data); | |
} | |
else | |
{ | |
$this->some_model->update($data); | |
} |
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
1)In ~/.bash_profile make sure | |
--------------------------------------- | |
PATH=$PATH:/usr/local/zend/bin:/usr/local/zend/mysql/bin | |
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/zend/lib | |
2) | |
sudo ln -s /usr/lib/libltdl.7.dylib /usr/lib/libltdl.3.dylib | |
3) | |
sudo pear channel-discover pear.php-tools.net |
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
/** | |
* @name backtype | |
* @author Nithin Meppurathu | |
* @author_url http://www.nitmedia.com | |
* @version 1.1 | |
* @license Do Not distribute under any terms | |
* | |
* Backtype library for Codeigniter. | |
* Class Helps us connect with the backtype api and get back results. | |
* |
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
alias bashp='subl ~/.bash_profile' | |
alias ll='ls -lhaG' | |
alias refresh='. ~/.bash_profile' | |
alias zend='sudo /usr/local/zend/bin/zendctl.sh' | |
alias sites='cd ~/Sites' | |
alias hubot='cd ~/Sites/hubot;bin/hubot' | |
alias subl='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl' | |
alias mongo_start='launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist' | |
# PS1 prompt color vars |
NewerOlder