AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   newbie problem with sqlx "no such table" (https://forums.alliedmods.net/showthread.php?t=84855)

Exceed 02-01-2009 21:46

newbie problem with sqlx "no such table"
 
I get the error message, "no such table: User_info" as i am connection to my database.

I have a table called User_info with 2 rows in it.

This is the first time i am trying to use sqlx and i have no idea if i am doing it right (i have very little experience with small).

PHP Code:

public LoadData(id)
{
    new 
AuthID[32], PlayerXP[32], PlayerLevel[32], PlayerClass[33], PlayerMoney[32], PlayerKills[32], PlayerDeath[32]
    
get_user_authid(id,AuthID,31)
    
    new 
error[128], ErrorCode
    
    
new Handle:info SQL_MakeDbTuple(sqlHost,sqlUser,sqlPass,sqlDB)
    new 
Handle:sql SQL_Connect(g_SqlTuple,ErrorCode,g_Error,511)
    
    new 
Handle:Query SQL_PrepareQuery(sql,"SELECT %s,%s,%s,%s,%s FROM %s WHERE %s='%s'",sqlMoney,sqlKills,sqlDeaths,sqlExp,sqlLevel,sqlTable,sqlAuthid,AuthID)
    
    if (!
SQL_Execute(Query))
    {
        
SQL_QueryError(Queryerror127)
        
server_print("[AMXX] Could not connect to SQL database. Error: %s"error)
    } else {
    
        
PlayerMoney[id] = SQL_FieldNameToNum(QuerysqlMoney)
        
PlayerKills[id] = SQL_FieldNameToNum(QuerysqlKills)
        
PlayerDeath[id]  = SQL_FieldNameToNum(QuerysqlDeaths)
        
PlayerXP[id]  = SQL_FieldNameToNum(QuerysqlExp)
        
PlayerLevel[id] = SQL_FieldNameToNum(QuerysqlLevel)
}
        
SQL_FreeHandle(Query)
        
SQL_FreeHandle(sql)
        
SQL_FreeHandle(info)

    return 
PLUGIN_CONTINUE


Thankyou for your time.

Hawk552 02-02-2009 09:19

Re: newbie problem with sqlx "no such table"
 
It's probably the wrong database; make it print out sqlDB.

Exceed 02-02-2009 11:34

Re: newbie problem with sqlx "no such table"
 
PHP Code:

server_print("sqlHost: %s. sqlUser: %s. sqlPass: %s. sqlDB: %s. sqlTable: %s."sqlHost,sqlUser,sqlPass,sqlDB,sqlTable

returns:
sqlHost: mysql.keep-gaming.com.
sqlUser: keep_gaming_com.
sqlPass: [Censored].
sqlDB: keep_gaming_com_db.
sqlTable: User_info.

Which is exactly what is should.


All times are GMT -4. The time now is 01:38.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.