Comments - Moving from MySQL to MariaDB in Debian 9

6 years, 8 months ago leszek tojatak

mariadb with msql support ( mysqli )

https://pastebin.com/qfuyZMQP

https://pastebin.com/uu2ka0xa

https://pastebin.com/2G3hQLpv

{
		$this->db_addr = $db_addr;
		$this->db_user = $db_user;
		$this->db_pass = $db_pass;
		
		$this->querycount = 0;
		
		if ( $use_pconnect )
		{
			$this->link = @mysqli_connect("p:".$db_addr, $db_user, $db_pass);
		}
		else
		{
			$this->link = @mysqli_connect($db_addr, $db_user, $db_pass);
		}
		
		if ( $this->link )
		{
			$q = @mysqli_query($this->link, "SET NAMES 'utf8'");
			@mysqli_free_result($q);
			if ( $db_name != '' )
			{
				$this->db_name = $db_name;
				if ( !@mysqli_select_db($this->link, $db_name) )
				{
					@mysqli_close($this->db_connect_id);
					$this->error("Could not select database '$db_name'. Check that the value of DB_NAME in config.php is set correctly.");
				}
			}
			return $this->link;
		}
		else
		{
			$this->error('Could not connect to database server. Check that the values of DB_ADDR, DB_USER and DB_PASS in config.php are set correctly.');
		}
	}

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.