downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

mysqli::savepoint> <mysqli::rollback
[edit] Last updated: Fri, 17 May 2013

view this page in

mysqli::rpl_query_type

mysqli_rpl_query_type

(PHP 5)

mysqli::rpl_query_type -- mysqli_rpl_query_typeReturns RPL query type

Descrizione

Stile orientato agli oggetti

int mysqli::rpl_query_type ( string $query )

Stile procedurale

int mysqli_rpl_query_type ( mysqli $link , string $query )

Returns MYSQLI_RPL_MASTER, MYSQLI_RPL_SLAVE or MYSQLI_RPL_ADMIN depending on a query type. INSERT, UPDATE and similar are master queries, SELECT is slave, and FLUSH, REPAIR and similar are admin.

Avviso

Questa funzione, al momento non è documentata; è disponibile soltanto la lista degli argomenti.

Avviso

Questa funzionalità è DEPRECATA e RIMOSSA dal PHP 5.3.0.



add a note add a note User Contributed Notes mysqli::rpl_query_type - [2 notes]
up
0
steohan at gobro dot de
2 years ago
Because the sql types could be combined it would be better to use a function like this:

function getMySQLType($str){
      $str=trim($str);
      return strtoupper(substr($str,0,strpos($str,' ')));     
}

$sql="select * from user;";
if (getMySQLType($sql) == 'SELECT'){
//true
}
up
0
technique-glamour at condenast dot fr
5 years ago
WARNING : this function (or maybe the "enable_rpl_parse" function) randomly causes a segfault into PHP.
We don't use this function anymore. Instead we check if the query contains the word 'SELECT' :

function query_type($query)
{
    if ( stripos($query,'SELECT'))   
        return true;
    return false;
}

 
show source | credits | stats | sitemap | contact | advertising | mirror sites