Skip to content

Instantly share code, notes, and snippets.

@yunake
Created December 11, 2015 21:25
Show Gist options
  • Save yunake/c872d0baeda37035c414 to your computer and use it in GitHub Desktop.
Save yunake/c872d0baeda37035c414 to your computer and use it in GitHub Desktop.
$master_success = @mysqli_select_db($this->read_link, $database) or $this->error("[READ] Unable to select database", $this->read_link);
if($this->write_link)
{
$slave_success = @mysqli_select_db($this->write_link, $database) or $this->error("[WRITE] Unable to select slave database", $this->write_link);
$success = ($master_success && $slave_success ? true : false);
}
else
{
$success = $master_success;
}
return $success;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment