Hi guys i was wondering if we could add the MySQL REPLACE command in the /libraries/joomla/database/query.php.
I've been trying to do so, unsuccessfully.
I've been trying to copy the SET to REPLACE to submit the code here...
For example in line 1383 we have a code to SET:
/**
* Add a single condition string, or an array of strings to the SET clause of the query.
*
* Usage:
* $query->set('a = 1')->set('b = 2');
* $query->set(array('a = 1', 'b = 2');
*
* @param mixed $conditions A string or array of string conditions.
* @param string $glue The glue by which to join the condition strings. Defaults to ,.
* Note that the glue is set on first use and cannot be changed.
*
* @return JDatabaseQuery Returns this object to allow chaining.
*
* @since 11.1
*/
public function set($conditions, $glue = ',')
{
if (is_null($this->set))
{
$glue = strtoupper($glue);
$this->set = new JDatabaseQueryElement('SET', $conditions, "\n\t$glue ");
}
else
{
$this->set->append($conditions);
}
return $this;
}
Ok tomorrow i'll try that... thx..
Labels |
Added:
?
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-09-23 13:21:48 |
Closed_By | ⇒ | zero-24 |
Category | ⇒ | Libraries |
Closing as we have a Pull here: #7934 Thanks.
PRs welcome. Just note that if you put it in the main JDatabaseQuery class it needs to be usable for all database drivers. If this is a MySQL specific thing, it needs to be placed in the MySQL query subclasses.