Hi,
I am using the latest Combu 3.2.2 and started from scratch. I have the database created using dbeaver and run the table creation SQL script successfully. Everything was fine. When I tried to create a new app via Registered App->Create App, after filling the form and pressed the save button the message "Data has been correctly saved" was displayed, however nothing was saved into the appid table. To ensure it is not a DB connection issues, I tried Server Settings->Create and successfully created a few keypairs and the data were saved to serversettings table correctly. I am thinking maybe you have some suggestion before I spend more time finding the issue
FYI the local environment I am using - Nginx 1.18, PHP 8.0 NTS and MySQL 8.0.22 Community
Thanks and Regards
It's pretty strange that you're receiving a successful message after executing the query if it's not saving, you can edit the function Save inside /vendor/skaredcreations/combu-lib/combu/AppId.php and add the following code after the line that contains "$Database->Query($query)":
echo "<pre>$query</pre>"; exit();
This way you should see the SQL query being executed (the AppId and Secret fields should contain random GUID-like strings), then try to execute it in your MySql tool software (phpMyAdmin, MySql Workbench, DBeaver, etc) to see if it's creating a record or giving an error.
FRANCESCO CROCETTI @ SKARED CREATIONS
Hi,
Sorry for my late reply, the game is just a personal side project. Weekend now :), I have more time and here's the SQL
- SELECT Id FROM `AppId` WHERE Name = 'test' AND Id <> new' --> the check Exists SQL
- UPDATE `AppId` SET Active = 0, Name = 'test', Description = 'Test TEST' WHERE Id = 0 --> the Save SQL
The SQL is obviously wrong, it should be INSERT or REPLACE. The AppId table is empty.
Hi,
I have solved the issue with a simple modification to the AppId.php which I share below for your input. FYI the AppId.php is located in <COMBU Installation Folder>\vendor\skaredcreations\combu\combu folder.
Seeing the different folder you mentioned in your reply, I wonder would it be the combu asset in Unity App Store has some unknown issues.
Below is my simple modification that has make it work
public function Save()
{
global $Database;
if ($this->Id == 'new') --> I added this
{
$this->Id = 0;
}
if ($this->Id > 0) {
$query = sprintf("UPDATE %s SET Active = %d, Name = '%s', Description = '%s' WHERE Id = %d",
....
} else {
$this->Active = 1;
$this->AppId = Utils::NewGUID();
$this->Secret = Utils::NewGUID();
$this->DateCreated = Utils::GetCurrentDateTimeFormat();
$query = sprintf("INSERT INTO %s (Active, DateCreated, AppId, Secret, Name, Description) VALUES (%d, %s, '%s', '%s', '%s', '%s')",
.....
}
....
}