Zeile 194 | Zeile 194 |
---|
if(array_key_exists('hostname', $connections[$type])) { $details = $connections[$type];
|
if(array_key_exists('hostname', $connections[$type])) { $details = $connections[$type];
|
unset($connections);
| unset($connections[$type]);
|
$connections[$type][] = $details; }
| $connections[$type][] = $details; }
|
Zeile 288 | Zeile 288 |
---|
{ global $mybb;
|
{ global $mybb;
|
$string = preg_replace("#LIMIT (\s*)([0-9]+),(\s*)([0-9]+)$#im", "LIMIT $4 OFFSET $2", trim($string));
| $string = preg_replace("#LIMIT (\s*)([0-9]+),(\s*)([0-9]+);?$#im", "LIMIT $4 OFFSET $2", trim($string));
|
$this->last_query = $string;
| $this->last_query = $string;
|
Zeile 479 | Zeile 479 |
---|
*/ function insert_id() {
|
*/ function insert_id() {
|
$this->last_query = str_replace(array("\r", "\t"), '', $this->last_query); $this->last_query = str_replace("\n", ' ', $this->last_query); preg_match('#INSERT INTO ([a-zA-Z0-9_\-]+)#i', $this->last_query, $matches);
| preg_match('#INSERT\s+INTO\s+([a-zA-Z0-9_\-]+)#i', $this->last_query, $matches);
|
$table = $matches[1];
| $table = $matches[1];
|
Zeile 964 | Zeile 962 |
---|
*/ function escape_string_like($string) {
|
*/ function escape_string_like($string) {
|
return $this->escape_string(str_replace(array('%', '_') , array('\\%' , '\\_') , $string));
| return $this->escape_string(str_replace(array('\\', '%', '_') , array('\\\\', '\\%' , '\\_') , $string));
|
}
/**
| }
/**
|
Zeile 1418 | Zeile 1416 |
---|
* @param string $table The table * @param string $column The column name * @param string $new_definition the new column definition
|
* @param string $table The table * @param string $column The column name * @param string $new_definition the new column definition
|
* @param boolean $new_not_null Whether to drop or set a column * @param boolean $new_default_value The new default value (if one is to be set)
| * @param boolean|string $new_not_null Whether to "drop" or "set" the NOT NULL attribute (no change if false) * @param boolean|string $new_default_value The new default value, or false to drop the attribute
|
* @return bool Returns true if all queries are executed successfully or false if one of them failed */ function modify_column($table, $column, $new_definition, $new_not_null=false, $new_default_value=false)
| * @return bool Returns true if all queries are executed successfully or false if one of them failed */ function modify_column($table, $column, $new_definition, $new_not_null=false, $new_default_value=false)
|
Zeile 1443 | Zeile 1441 |
---|
$result2 = $this->write_query("ALTER TABLE {$this->table_prefix}{$table} ALTER COLUMN {$column} {$set_drop} NOT NULL"); }
|
$result2 = $this->write_query("ALTER TABLE {$this->table_prefix}{$table} ALTER COLUMN {$column} {$set_drop} NOT NULL"); }
|
if($new_default_value !== false)
| if($new_default_value !== null)
|
{
|
{
|
$result3 = $this->write_query("ALTER TABLE {$this->table_prefix}{$table} ALTER COLUMN {$column} SET DEFAULT {$new_default_value}"); } else { $result3 = $this->write_query("ALTER TABLE {$this->table_prefix}{$table} ALTER COLUMN {$column} DROP DEFAULT");
| if($new_default_value !== false) { $result3 = $this->write_query("ALTER TABLE {$this->table_prefix}{$table} ALTER COLUMN {$column} SET DEFAULT {$new_default_value}"); } else { $result3 = $this->write_query("ALTER TABLE {$this->table_prefix}{$table} ALTER COLUMN {$column} DROP DEFAULT"); }
|
}
return $result1 && $result2 && $result3;
| }
return $result1 && $result2 && $result3;
|
Zeile 1462 | Zeile 1463 |
---|
* @param string $old_column The old column name * @param string $new_column the new column name * @param string $new_definition the new column definition
|
* @param string $old_column The old column name * @param string $new_column the new column name * @param string $new_definition the new column definition
|
* @param boolean $new_not_null Whether to drop or set a column * @param boolean $new_default_value The new default value (if one is to be set)
| * @param boolean|string $new_not_null Whether to "drop" or "set" the NOT NULL attribute (no change if false) * @param boolean|string $new_default_value The new default value, or false to drop the attribute
|
* @return bool Returns true if all queries are executed successfully */ function rename_column($table, $old_column, $new_column, $new_definition, $new_not_null=false, $new_default_value=false)
| * @return bool Returns true if all queries are executed successfully */ function rename_column($table, $old_column, $new_column, $new_definition, $new_not_null=false, $new_default_value=false)
|