http.Get usage

Would the server mind it if I used http.Get every event to open a webpage like this:
A user says Haha:
mysite.com/logs.php?password=secret&add=chat&name=Player 1&text=Haha ?

I want the server to not have to query my db all the time so I would use a webpage to do it.
Is this a good idea?

PS: The password=secret would be to prevent people from adding logs themselves.

I dont know the feelings of your server but you would be better off using mysql, in the case of a spammer your server could become very unhappy

Yeah, thats the point, I would of course kick people that spam to much in some way. But my question is, is the tmysql module faster then http.Get?

Probably not but your not very likely to see a difference unless you can pause time.

You could just save messages to a table and using mysql to write them all at once other than every time somebody talks.

Its better to use tmysql or mysqloo, seems unnecessary to create a http request every time someone sais anything in the chat…

Well I could also save it in a table and then use json to encode it in lua, request the http with that encoded table and then in the php webpage decode json and put it in the database.

THe http.Get running a php script using mysql isnt really what we meant

its better to use the modules cause you dont have to run 2 scripts, just 1.
It will save memory on the server idk how much but it will.

Alright, that was the answer I was looking for :stuck_out_tongue_winking_eye:

Thanks for the help, I will:

  • Save all logs in a table
  • Save it in a mysql db every 2 hours or something.

If you add it to the mysql you can then empty the table after to save some resources

you do know the table will be HUGE if you wait 2 hours to save.
Do it every 10 minutes or so.

Great idea, thanks.

True… I might do it if the table is larger then maybe an X amount of lines?