Why my query ‘REPLACE INTO…’ does not work?

The reason is due to this code inside dbDelta() : // Create a tablename index for an array ($cqueries) of queries. foreach ( $queries as $qry ) { if ( preg_match( ‘|CREATE TABLE ([^ ]*)|’, $qry, $matches ) ) { $cqueries[ trim( $matches[1], ‘`’ ) ] = $qry; $for_update[ $matches[1] ] = ‘Created table ‘ … Read more

dbDelta with the character ;

That happens for this reason : The function dbDelta can receive as first parameter ($queries) an array or a string. If $queries is a string, dbDelta will make an array with “;” as delimiter. inside dbDelta if ( !is_array($queries) ) { $queries = explode( ‘;’, $queries ); $queries = array_filter( $queries ); } So the … Read more