Mysqloo with derma


I’m currently making a small inventory panel and i want to get data from my db but i’m stucked.
I have read on somes website and documentations that we can’t use mysql on serverside so what i should do ?

I have my clientside derma panel and my shared inventory system who contains a remove,add, receive item function but the receive function won’t work, i don’t understand.
All is working fine on my projet but i’m still stucked with this error.
I have shearched but i didn’t found anything about that.


What do you mean that you can’t use mysql on serverside

I mean that when i include my database file who require mysqloo on clientside, it’s doesn’t work.

[ERROR] gamemodes/survival/gamemode/modules/vgui/database.lua:1: Module not found!
  1. require - [C]:-1
   2. unknown - gamemodes/survival/gamemode/modules/vgui/database.lua:1
    3. include - [C]:-1
     4. unknown - gamemodes/survival/gamemode/cl_init.lua:3

why would you read anything on clientside? Please don’t tell me that you’re trying to save the inventory data on the client. Just have the inventory on serverside, network it to player, and if player moves anything, etc. network it back to server so it could update, and then, on serverside query the db about the changes only if the player leaves/every x minutes.

Never ever ever EVER do mysql stuff clientsided, that’s just asking for trouble.

Doing what you’re doing requires the mysql credentials to be send to the client and this isn’t even possible.

Do all mysql stuff on the server and use the net libary to communicate to the client.

Looking at what you’re doing you don’t know anything about this and for the love of god i hope you know what escaping is.

Why wouldnt it be possible to send server credentials to the client?

Prepared statements.

Otherwise I agree with what you said. To OP: What these guys said. Do all of your database shit on the server and network it to the client, there are no 2 ways about it.

Why in hell would you send the mysql credetials to the client? i’m sure it would be possible but i don’t think you’re very smart if you send that to the client and trust the client in doing database queries. Looking at his error it’s obvious his mysql init code is being sent to the client.

I think if he tried to query the db on client he’d query the one on his local machine, not the server one, so server wouldn’t get the data anyways.