reduce table name size

merge-requests/3/head
Julien Veyssier 2017-08-27 18:10:43 +02:00
parent 030fe798e7
commit 62298b17a0
2 changed files with 5 additions and 5 deletions

View File

@ -99,7 +99,7 @@
</declaration> </declaration>
</table> </table>
<table> <table>
<name>*dbprefix*gpxedit_options_values</name> <name>*dbprefix*gpxedit_options</name>
<declaration> <declaration>
<field> <field>
<name>id</name> <name>id</name>

View File

@ -288,7 +288,7 @@ class UtilsController extends Controller {
*/ */
public function saveOptionsValues($optionsValues) { public function saveOptionsValues($optionsValues) {
// first we check if user already has options values in DB // first we check if user already has options values in DB
$sqlts = 'SELECT jsonvalues FROM *PREFIX*gpxedit_options_values '; $sqlts = 'SELECT jsonvalues FROM *PREFIX*gpxedit_options ';
$sqlts .= 'WHERE '.$this->dbdblquotes.'user'.$this->dbdblquotes.'=\''.$this->userId.'\' '; $sqlts .= 'WHERE '.$this->dbdblquotes.'user'.$this->dbdblquotes.'=\''.$this->userId.'\' ';
$req = $this->dbconnection->prepare($sqlts); $req = $this->dbconnection->prepare($sqlts);
$req->execute(); $req->execute();
@ -301,7 +301,7 @@ class UtilsController extends Controller {
// if nothing is there, we insert // if nothing is there, we insert
if ($check === null){ if ($check === null){
$sql = 'INSERT INTO *PREFIX*gpxedit_options_values'; $sql = 'INSERT INTO *PREFIX*gpxedit_options';
$sql .= ' ('.$this->dbdblquotes.'user'.$this->dbdblquotes.', jsonvalues) '; $sql .= ' ('.$this->dbdblquotes.'user'.$this->dbdblquotes.', jsonvalues) ';
$sql .= 'VALUES (\''.$this->userId.'\','; $sql .= 'VALUES (\''.$this->userId.'\',';
$sql .= '\''.$optionsValues.'\');'; $sql .= '\''.$optionsValues.'\');';
@ -311,7 +311,7 @@ class UtilsController extends Controller {
} }
// else we update the values // else we update the values
else{ else{
$sqlupd = 'UPDATE *PREFIX*gpxedit_options_values '; $sqlupd = 'UPDATE *PREFIX*gpxedit_options ';
$sqlupd .= 'SET jsonvalues=\''.$optionsValues.'\' '; $sqlupd .= 'SET jsonvalues=\''.$optionsValues.'\' ';
$sqlupd .= 'WHERE '.$this->dbdblquotes.'user'.$this->dbdblquotes.'=\''.$this->userId.'\' ; '; $sqlupd .= 'WHERE '.$this->dbdblquotes.'user'.$this->dbdblquotes.'=\''.$this->userId.'\' ; ';
$req = $this->dbconnection->prepare($sqlupd); $req = $this->dbconnection->prepare($sqlupd);
@ -337,7 +337,7 @@ class UtilsController extends Controller {
* @NoAdminRequired * @NoAdminRequired
*/ */
public function getOptionsValues($optionsValues) { public function getOptionsValues($optionsValues) {
$sqlov = 'SELECT jsonvalues FROM *PREFIX*gpxedit_options_values '; $sqlov = 'SELECT jsonvalues FROM *PREFIX*gpxedit_options ';
$sqlov .= 'WHERE '.$this->dbdblquotes.'user'.$this->dbdblquotes.'='.$this->db_quote_escape_string($this->userId).' ;'; $sqlov .= 'WHERE '.$this->dbdblquotes.'user'.$this->dbdblquotes.'='.$this->db_quote_escape_string($this->userId).' ;';
$req = $this->dbconnection->prepare($sqlov); $req = $this->dbconnection->prepare($sqlov);
$req->execute(); $req->execute();