Hello bugsy thanks for the info but i did exactly like this and read this tutorial too
https://forums.alliedmods.net/showthread.php?t=132686
Here is my code and is still not working
PHP Code:
#include <amxmodx>
#include <sqlx>
new Host[] = "localhost"
new User[] = "root"
new Pass[] = ""
new Db[] = "sqltest"
new Handle:g_SqlTuple
new g_Error[512]
public plugin_init() {
register_plugin("PLUGIN", "VERSION", "AUTHOR")
set_task(1.5, "Load_MySql")
}
public plugin_end()
SQL_FreeHandle(g_SqlTuple)
public Load_MySql()
{
g_SqlTuple = SQL_MakeDbTuple(Host,User,Pass,Db)
new errorCode
new Handle:sql = SQL_Connect(g_SqlTuple, errorCode, g_Error, charsmax(g_Error))
new Handle:query
new foundEXP[10], foundSteam[33]
query = SQL_PrepareQuery(sql,"SELECT * FROM `tutorial` ORDER BY `exp`")
server_print("STAGE 2")
while(SQL_MoreResults(query))
{
server_print("STAGE 3")
SQL_ReadResult(query, 0, foundSteam, charsmax(foundSteam))
SQL_ReadResult(query, 1, foundEXP, charsmax(foundEXP))
server_print("%s EXP = %d", foundSteam, str_to_num(foundEXP)) // Just to view it in server console
SQL_NextRow(query)
}
}
It never outputs STAGE 3 ..
Edit:
I even added this after the preparation of my query
PHP Code:
server_print("Results %d", SQL_NumResults(query))
And it outputs "Results 0"
Even my Table has 2 Enteries in it