SushiTee/teeworlds

Server | SQL

Closed this issue · 3 comments

How i can use execute for insert in sql database in engine/server/server.cpp

I use a mysql c++ connector library to connect to a mysql database. The lib is included in the teerace-0.6 branch here. There you can see how to configure all the stuff to make it work with teeworlds by looking into the relevant files (bam.lua etc.).
If you need help in actually using the connector have a look into the docs of the connector: http://dev.mysql.com/doc/connector-cpp/en/connector-cpp-getting-started-examples.html

SushiTee
how create kick in sql_score.cpp for if find a player with name test?
str_format(aBuf, sizeof(aBuf), "select Name from %s_blacklist where Name = 'test'", pData->m_pSqlData->m_pPrefix, pData->m_aName);

pData->m_pSqlData->m_pResults = pData->m_pSqlData->m_pStatement->executeQuery(aBuf);

I didn't find any think about this in teerace mod

please don't use github issues to ask how you do something!

The issues are for problems with the code provided here. What you are asking is not a problem of my code. It's a problem of yours.