note 100056 deleted from mysqli.rpl-query-type by cmb
| From: | cmb@php.net | Date: | Wed, 28 Oct 2020 17:21:39 +0000 |
| Subject: | note 100056 deleted from mysqli.rpl-query-type by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215666@lists.php.net to get a copy of this message | ||
Note Submitter: steohan at gobro dot de
----
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
}