Jump to the post that solved this thread.
Solved: 6 Years, 8 Months ago Problem after update to MyBB 1.8.6 (from 1.8.5)
#41
Solved: 6 Years, 8 Months ago
(2015-10-17, 02:48 AM)Destroy666 Wrote: 1. Open both files.
2. Find green parts (CTRL + F).
3. Change them to red parts.

Thanks!  Now I get it.  Has this particular issue already been fixed in 1.8.6?  I ask because my files already look like the green parts (without the red parts)...  So maybe my issue is caused by something else?

DB_MYSQL.PHP
		if($prefix)
		{
			$query = $this->query("
				SELECT `TABLE_NAME` FROM INFORMATION_SCHEMA.TABLES 
				WHERE `TABLE_SCHEMA` = '$database' AND `TABLE_TYPE` = 'BASE TABLE' 
				AND `TABLE_NAME` LIKE '".$this->escape_string($prefix)."%'
			");
		}
		else
		{
			$query = $this->query("
				SELECT `TABLE_NAME` FROM INFORMATION_SCHEMA.TABLES 
				WHERE `TABLE_SCHEMA` = '$database' AND `TABLE_TYPE` = 'BASE TABLE'
			");
		}

		$tables = array();
		while(list($table) = mysql_fetch_array($query))
		{
			$tables[] = $table;
		}

		return $tables;
	}

	/**
	 * Check if a table exists in a database.
	 *
	 * @param string $table The table name.
	 * @return boolean True when exists, false if not.
	 */
	function table_exists($table)
	{
		// Execute on master server to ensure if we've just created a table that we get the correct result
		$query = $this->write_query("
			SELECT `TABLE_NAME` FROM INFORMATION_SCHEMA.TABLES 
			WHERE `TABLE_TYPE` = 'BASE TABLE' 
			AND `TABLE_NAME` LIKE '{$this->table_prefix}$table'
		");
		$exists = $this->num_rows($query);
		if($exists > 0)

DB_MSQLI.PHP
		if($prefix)
		{
			$query = $this->query("
				SELECT `TABLE_NAME` FROM INFORMATION_SCHEMA.TABLES 
				WHERE `TABLE_SCHEMA` = '$database' AND `TABLE_TYPE` = 'BASE TABLE' 
				AND `TABLE_NAME` LIKE '".$this->escape_string($prefix)."%'
			");
		}
		else
		{
			$query = $this->query("
				SELECT `TABLE_NAME` FROM INFORMATION_SCHEMA.TABLES 
				WHERE `TABLE_SCHEMA` = '$database' AND `TABLE_TYPE` = 'BASE TABLE'
			");
		}

		$tables = array();
		while(list($table) = mysqli_fetch_array($query))
		{
			$tables[] = $table;
		}
		return $tables;
	}

	/**
	 * Check if a table exists in a database.
	 *
	 * @param string $table The table name.
	 * @return boolean True when exists, false if not.
	 */
	function table_exists($table)
	{
		// Execute on master server to ensure if we've just created a table that we get the correct result
		$query = $this->write_query("
			SELECT `TABLE_NAME` FROM INFORMATION_SCHEMA.TABLES 
			WHERE `TABLE_TYPE` = 'BASE TABLE' 
			AND `TABLE_NAME` LIKE '{$this->table_prefix}$table'
		");
		$exists = $this->num_rows($query);
Reply
Jump to the post that solved this thread.


Messages In This Thread
RE: Problem after update to MyBB 1.8.6 (from 1.8.5) - by Jayfore - 2015-10-17, 08:03 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)