Recent Topics

Support for MySQL < 4?

Started by on Jan 27, 2007 – Contents updated: Sep 25, 2013

Jan 27, 2007 13:18    

Hi. In my research in b2evolution to port it to another database, I've found some code like:


		$mysql_ver = mysql_get_server_info();

		if( ($pos = strpos($mysql_ver, '.')) && substr( $mysql_ver, 0, $pos ) >= '4' )

		{ // MySQL server version >= 4 (required for multi-table deletes):

			$rows_affected = $DB->query( '

				DELETE T_basedomains

				  FROM T_basedomains LEFT JOIN T_hitlog ON hit_referer_dom_ID = dom_ID

				 WHERE hit_referer_dom_ID IS NULL

				 AND dom_type = \'unknown\'

				 AND dom_status = \'unknown\'' );

			$Debuglog->add( 'Hitlist::dbprune(): autopruned '.$rows_affected.' rows from T_basedomains.', 'hit' );

		}

		else

		{ // two queries for MySQL < 4

			$ids = $DB->get_row( '

				SELECT dom_ID

				  FROM T_basedomains LEFT JOIN T_hitlog ON hit_referer_dom_ID = dom_ID

				 WHERE hit_referer_dom_ID IS NULL

				 AND dom_type = \'unknown\'

				 AND dom_status = \'unknown\'', ARRAY_N );

Do we really need support to MySQL <4 ?

Code that depends on mysql_get_server_info is just on inc/MODEL/sessions/_hitlist.class.php.

[]'s
- Walter

Sep 25, 2013 01:31

We now required MySQL v5 minimum.


Form is loading...

Build your own website! – This forum is powered by b2evolution CMS, a complete engine for your website.