TheOtherSide Posted July 19, 2018 Share Posted July 19, 2018 (edited) hello can I create database in my script and make a connection to it from another server ( how give me an example ) ? and can I insert an image for it ? is there anyway to insert an image without using base64string ? thanks Edited July 19, 2018 by MTASAPLAYER Link to comment
Mr.Loki Posted July 19, 2018 Share Posted July 19, 2018 You can use callRemote to access another server. The example shows you how. if you are passing the image from within the server to the database you you have to convert the texture to pixels of the format you want dxConvertPixels then save it as a string within the database. I've never tried this but i think it should work. GL Link to comment
TheOtherSide Posted July 20, 2018 Author Share Posted July 20, 2018 11 hours ago, Mr.Loki said: You can use callRemote to access another server. The example shows you how. if you are passing the image from within the server to the database you you have to convert the texture to pixels of the format you want dxConvertPixels then save it as a string within the database. I've never tried this but i think it should work. GL I got that thanks , but ' callRemote ' I can access another server but how to access a specific db , like I have a script called Test1 and there's a db in the script called img.db , how to access this db ? from another server, provide an example please , I have seen the wiki already . I don't know if this is possible ? Link to comment
Addlibs Posted July 20, 2018 Share Posted July 20, 2018 (edited) I don't believe you can externally access a database through the client via fetchRemote or callRemote unless you put that through a web-server run PHP code or a Lua-parsed server http file (https://wiki.multitheftauto.com/wiki/Resource_Web_Access). An easier option would be to have the server serve the data by accessing and collecting the data directly from the database, and sending it through a event (preferable a latent one, that is, triggerLatentClientEvent) to the client. Edited July 20, 2018 by MrTasty Link to comment
TheOtherSide Posted July 20, 2018 Author Share Posted July 20, 2018 34 minutes ago, MrTasty said: I don't believe you can externally access a database through the client via fetchRemote or callRemote unless you put that through a web-server run PHP code or a Lua-parsed server http file (https://wiki.multitheftauto.com/wiki/Resource_Web_Access). An easier option would be to have the server serve the data by accessing and collecting the data directly from the database, and sending it through a event (preferable a latent one, that is, triggerLatentClientEvent) to the client. i know the mechanism already but this is what i wanted https://wiki.multitheftauto.com/wiki/Resource_Web_Access thanks bro Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now