Skip to content

Instantly share code, notes, and snippets.

@paulomcnally
Created October 15, 2012 14:14
Show Gist options
  • Save paulomcnally/3892664 to your computer and use it in GitHub Desktop.
Save paulomcnally/3892664 to your computer and use it in GitHub Desktop.
mt_twitter_accounts_add
/**
* @Method mt_twitter_accounts_add
* @Desc Add new twitter account
*/
public function mt_twitter_accounts_add( )
{
$query = "REPLACE INTO tblTwitterAccounts
(
id,
screen_name,
oauth_token,
oauth_token_secret,
app_id
) VALUES
(
'".$this->post_data['id']."',
'".$this->post_data['screen_name']."',
'".$this->post_data['oauth_token']."',
'".$this->post_data['oauth_token_secret']."',
'".$this->post_data['app_id']."'
)";
$this->mysql->query( $query );
if( $this->mysql->rows_affected > 0 )
{
$this->fn_set_json_type(true);
$this->fn_set_json_message( "Ok" );
}
else
{
$this->fn_set_json_type(false);
$this->fn_set_json_message("Hubo un error al intentar guardar la cuenta de twitter.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment