[Standalone] OxMySQL - Lightweight MySQL wrapper

You don’t have this table in your database.

edit:

Also this one.

1 Like

so what do i have to do, i never worked with mysql

Install the .sql files provided by those resources into your database.

ah ok thanks a lot !

can we use both mysqlasync and oxsql at the same time

why would you do that ?

i bought a script that depends on mysqlasync but I am using oxmysql for my server

you only have to change the export name to oxmysql instead of mysql-async

1 Like

Hey there I have a question about OxMySQL :slight_smile:

Does it now include backward compatibility with the old mysql-async queries or do we still need to modify each and every queries from each and every scripts we have on the server to get it to work ?

Per say I got a few paid scripts which are fully obfuscated meaning I do not have any possibility to modify the queries from there which presents quite an issue when trying to switch from mysql-async to OxMySQL saddly…

Thank you in advance for your answer and GREAT work here !

Probs should attach a disclaimer somewhere about specifying this resource as a dependency. For whatever reason, it’ll tell you the resource wasn’t found regardless if it was started.

Solid resource otherwise and some great documentation that made converting to this mostly painless minus the dependency thing. :+1:

Somebody PR’d it a while ago and I forgot about it when I added the provide for mysql-async. It’s removed on the source but next build won’t be done for a little longer (working on allowing nil parameters from Lua). There’s a few official fixes coming with the API that I want in the next build too for a memory leak, optimisations to string decoding, etc. and it feels weird to have a node-patch file for somebody else’s work.

A request was made to allow server_only resources to be used for dependencies but d-bub said it wouldn’t be a trivial change, so I wouldn’t expect anything soon.

EDIT: Looks like they’ve actually been merged, now I wait for a build.

2 Likes
INSERT INTO users(id) VALUES(DEFAULT); SELECT LAST_INSERT_ID() AS id

Isn’t this accepted ?

I get a syntax error on in. :

[ERROR] fpt-core was unable to execute a query!
script:oxmysql  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 'SELECT LAST_INSERT_ID() AS id' at line 1
script:oxmysql INSERT INTO users(id) VALUES(DEFAULT); SELECT LAST_INSERT_ID() AS id
script:fpt-core] SCRIPT ERROR: @fpt-core/modules/dbwrapper.lua:26: attempt to get length of a nil value (local 'rows').
1 Like

Does oxmysql have MySQL Explorer also ?

1 Like

The retval for the insert function is the last inserted id, why are you trying to do multiple queries?

Multiple statements are disabled by default because they’re a surefire way for idiots to create exploitable queries (SQL injection).

1 Like

Oh, thanks :)) <3

1 Like

Nice job

1 Like

Done, thanks :smiley:

same thing

my run.bat just stop running
why dose it do that i did what everyone said