Posts: 723
Threads: 366
Joined: Jun 2016
Hi,
How with http for example safe message? like write player /pm [name] [message]
I want to safe message, send to php file, what message and what name, in php file get and write into mysql file.
Posts: 723
Threads: 366
Joined: Jun 2016
up topic
I tried something but there is problem when sending to php, when text is with & or +, not all symbols are reading i gues i need decode something, i read need to send decoded querie, but how in sa-mp format http, to make decode or something, that in php i could retrieve any string?
Posts: 74
Threads: 0
Joined: Mar 2016
Reputation:
0
Correct me if I'm wrong here but wouldn't it much more efficient to store what you want into the mysql database from the script directly instead of sending the string to a php file which connects to a SQL database and stores the string?
Posts: 1,661
Threads: 47
Joined: May 2013
Reputation:
0
Honestly I don't mean any offense but you post these kind of threads every day or so. You should learn the basics and then try to do what you want to do. This is all basic php and mysql.
4D1L mentioned what you should do.
Posts: 723
Threads: 366
Joined: Jun 2016
Because that query not impose server, like imaginage playing 500 players, and you are saving /pm, there can by 20 sms/second or more, i have on 100 players issues, not of course just pm saving,money other things, queries too much they don't have time to complete..
Posts: 1,915
Threads: 64
Joined: Jan 2016
Reputation:
0
So.. Why do you save /pm in PHP? Why you don't write basically logs in a .txt or .log file ?
Posts: 723
Threads: 366
Joined: Jun 2016
But that file can by very huge
Posts: 723
Threads: 366
Joined: Jun 2016
ANOther question, how to connect to database in php file only one time? because if i always call to php file and always connect to database there will be a lot of connections..
Posts: 889
Threads: 4
Joined: Mar 2013
Reputation:
0
MySQL queries are also threaded, just like HTTP requests. This means it won't impact the server in terms of blocking the main thread.