  |
31 | 31 | | if ($this->link = @mysqli_connect($this->server, $this->username, $this->password)) { |
| |
32 | 32 | | $this->setConnected(true); |
| |
33 | 33 | | |
  |
| 34 | + | if ( version_compare(mysqli_get_server_info($this->link), '5.0.2') >= 0 ) { |
| |
| 35 | + | $this->simpleQuery('set session sql_mode="STRICT_ALL_TABLES"'); |
| |
| 36 | + | } |
| |
| 37 | + | |
|
34 | 38 | | return true; |
| |
35 | 39 | | } else { |
| |
36 | 40 | | $this->setError(mysqli_connect_error(), mysqli_connect_errno()); |
| |
|
|
 |
… |
|
116 | 120 | | $this->error_number = null; |
| |
117 | 121 | | $this->error_query = null; |
| |
118 | 122 | | |
  |
| 123 | + | if ( mysqli_warning_count($this->link) > 0 ) { |
| |
| 124 | + | $warning_query = @mysqli_query($this->link, 'show warnings'); |
| |
| 125 | + | while ( $warning = mysqli_fetch_row($warning_query) ) { |
| |
| 126 | + | trigger_error(sprintf('[MYSQL] %s (%d): %s [QUERY] ' . $query, $warning[0], $warning[1], $warning[2]), E_USER_WARNING); |
| |
| 127 | + | } |
| |
| 128 | + | mysqli_free_result($warning_query); |
| |
| 129 | + | } |
| |
| 130 | + | |
  |
119 | 131 | | return $resource; |
| |
120 | 132 | | } else { |
| |
121 | 133 | | $this->setError(mysqli_error($this->link), mysqli_errno($this->link), $query); |