Thread: [Solved] Retrieve data from sql
View Single Post
N3v3rM1nd
Member
Join Date: Apr 2021
Old 04-24-2024 , 16:07   Re: Retrieve data from sql
Reply With Quote #3

Quote:
Originally Posted by Rohanlogs View Post
Hi. Do you have the code for "CREATE TABLE ..." query? Can you post it?
PHP Code:
public MySql_Init()
{
    
g_SqlTuple SQL_MakeDbTuple(Host,User,Pass,Db)

    new 
ErrorCode,Handle:SqlConnection SQL_Connect(g_SqlTuple,ErrorCode,g_Error,charsmax(g_Error))
    if(
SqlConnection == Empty_Handle)    set_fail_state(g_Error)

    new 
Handle:Queries
    Queries 
SQL_PrepareQuery(SqlConnection,"CREATE TABLE IF NOT EXISTS %s (steamid varchar(35), name VARCHAR(32), points INT(11), infections INT(11), kills INT(11), deaths INT(11), score INT(11))"TABEL)

    if(!
SQL_Execute(Queries))
    {
        
SQL_QueryError(Queries,g_Error,charsmax(g_Error))
        
set_fail_state(g_Error)
    }

    
SQL_FreeHandle(Queries)
    
SQL_FreeHandle(SqlConnection)   

I tried my best but im not that good in MySQL

Last edited by N3v3rM1nd; 04-24-2024 at 16:10.
N3v3rM1nd is offline