Patrix Posted June 2, 2023 Share Posted June 2, 2023 Introduction MySQL Module binds a third-party mysql library, which provides Squirrel functions to access data from MySQL databases. More information about MySQL database you will find on the internet. SQL language tutorial: https://www.w3schools.com/sql/ Used SDK: https://downloads.mysql.com/archives/c-c/ Project links: - Repository - Download - Documentation Usage example local conn = null addEventHandler("onInit", function() { conn = mysql_connect("localhost", "root", "", "db_test") if (!conn) throw "Cannot connect with server database!" local result = mysql_query(conn, "SELECT * FROM mdb_users") if (!result) throw mysql_error(conn) + "\ncode: " + mysql_errno(conn) print("Query done " + mysql_num_fields(result)) local row_assoc = mysql_fetch_assoc(result) if (row_assoc) print(row_assoc["username"] + " " + row_assoc["email"]) mysql_free_result(result) }) 2 Quote Link to comment Share on other sites More sharing options...
Patrix Posted June 30, 2023 Author Share Posted June 30, 2023 I'm happy to announce that i've finished working on MySQL module C API update! https://gitlab.com/GothicMultiplayerTeam/modules/mysql/-/releases/0.5 Feel free to use the new module that is using 8.0+ API, instead of old 6.1.11 version that was slowly losing support. Also, this module uses experimental setup (native builds instead of cross compiled ones), in time every module maintained by me will be updated to work on the same principle. Propably in near future you can also expect some async calls binds (work for new release) 😉 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.