Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question/Help] SQL Errors the day after it working fine #42

Closed
Cynist3r opened this issue Nov 12, 2023 · 3 comments
Closed

[Question/Help] SQL Errors the day after it working fine #42

Cynist3r opened this issue Nov 12, 2023 · 3 comments

Comments

@Cynist3r
Copy link

Cynist3r commented Nov 12, 2023

[Question/Help]

After using this in my test server perfectly, Multiple restarts with no errors and was working awesome, I moved it into my live server. I made sure to enter my SQL and I am now getting the errors below today.

I then went into my test server to see if there had been a change there and yes, It also was not working? I had not touched anything as once I got this working I called it a night. So I am very confused on what to do or what has happened

(node:137) UnhandledPromiseRejectionWarning: Error: mh-parking was unable to execute a query!
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CREATE TABLE IF NOT EXISTS player_parking_vips (
id int(10) N...' at line 22
CREATE TABLE IF NOT EXISTS player_parking (
id int(10) NOT NULL AUTO_INCREMENT,
citizenid varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
citizenname varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
model varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
modelname varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
plate varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
steerangle int(15) NOT NULL DEFAULT 0,
fuel int(15) NOT NULL DEFAULT 0,
engine int(15) NOT NULL DEFAULT 0,
body int(15) NOT NULL DEFAULT 0,
oil int(15) NOT NULL DEFAULT 0,
data longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
coords longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
time bigint(20) NOT NULL,
cost int(10) NOT NULL DEFAULT 0,
parktime int(10) NOT NULL DEFAULT 0,
parking varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (id) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

    CREATE TABLE IF NOT EXISTS `player_parking_vips` (
        `id` int(10) NOT NULL AUTO_INCREMENT,
        `citizenid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
        `citizenname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
        `maxparking` int(10) NOT NULL DEFAULT 0,
        `hasparked` int(10) NOT NULL DEFAULT 0,
        PRIMARY KEY (`id`) USING BTREE
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
     []
at @oxmysql/dist/build.js:22275:11
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

(node:137) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 17)

I have not ran into any errors like this before so I am just looking for some suggestions or help.

@Cynist3r Cynist3r changed the title SQL Error? [Question/Help] SQL Errors the day after it working fine Nov 12, 2023
@MaDHouSe79
Copy link
Owner

MaDHouSe79 commented Nov 12, 2023

is the script the same script from your test server or did you just download it? cause i had add something but that did not work well, so i remove it, so maby you have that one?

@Cynist3r
Copy link
Author

Yes i drag and dropped the working one from the test server into my main server. Making sure anything i have modified was also moved. It was working fine in my test server. I woke up the next day and i received the error in both the test and the live

@MaDHouSe79
Copy link
Owner

MaDHouSe79 commented Nov 13, 2023

you need to go in the server file at the buttom you see a dataabse MySql execute if you have that at the bottom than you have a the bad one, or you download a new one cause i already fix that issue.

Remove:

Citizen.CreateThread(function()
    Wait(5000)
    MySQL.Async.execute([[
        CREATE TABLE IF NOT EXISTS `player_parking` (
            `id` int(10) NOT NULL AUTO_INCREMENT,
            `citizenid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
            `citizenname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
            `model` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
            `modelname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
            `plate` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
            `steerangle` int(15) NOT NULL DEFAULT 0,
            `fuel` int(15) NOT NULL DEFAULT 0,
            `engine` int(15) NOT NULL DEFAULT 0,
            `body` int(15) NOT NULL DEFAULT 0,
            `oil` int(15) NOT NULL DEFAULT 0,
            `data` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
            `coords` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
            `time` bigint(20) NOT NULL,
            `cost` int(10) NOT NULL DEFAULT 0,
            `parktime` int(10) NOT NULL DEFAULT 0,
            `parking` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
            PRIMARY KEY (`id`) USING BTREE
        ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
        
        CREATE TABLE IF NOT EXISTS `player_parking_vips` (
            `id` int(10) NOT NULL AUTO_INCREMENT,
            `citizenid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
            `citizenname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
            `maxparking` int(10) NOT NULL DEFAULT 0,
            `hasparked` int(10) NOT NULL DEFAULT 0,
            PRIMARY KEY (`id`) USING BTREE
        ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
	]])
end)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants