Raised This Month: $ Target: $400
 0% 

newbie problem with sqlx "no such table"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exceed
Member
Join Date: Oct 2004
Old 02-01-2009 , 21:46   newbie problem with sqlx "no such table"
Reply With Quote #1

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.
__________________
Exceed^ - I JUST CAN'T STOP.
Exceed is offline
Old 02-02-2009, 09:11
Exceed
This message has been deleted by YamiKaitou. Reason: bump
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-02-2009 , 09:19   Re: newbie problem with sqlx "no such table"
Reply With Quote #2

It's probably the wrong database; make it print out sqlDB.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Exceed
Member
Join Date: Oct 2004
Old 02-02-2009 , 11:34   Re: newbie problem with sqlx "no such table"
Reply With Quote #3

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.
__________________
Exceed^ - I JUST CAN'T STOP.
Exceed is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:48.


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