Raised This Month: $51 Target: $400
 12% 

SQLX using wrongly local ip instead of host provided


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DJBosma
Member
Join Date: Dec 2009
Old 01-22-2023 , 16:09   SQLX using wrongly local ip instead of host provided
Reply With Quote #1

Hi there,

It seems that <sqlx> is using the wrong host when connecting to the database, instead of using the IP provided, it uses the IP where the game server sit's on.



PHP Code:
    #define HOST             "92.222.129.164"
    #define USER             "layerfor_levelstages"
    #define PASS             "pass"
    #define DB             "layerfor_levelstages"

    
g_SqlTuple SQL_MakeDbTuple(HOSTUSERPASSDB)
    
    new 
ErrorCode
    SqlConnection 
SQL_Connect(g_SqlTuple,ErrorCode,g_szError,charsmax(g_szError))
    if(!
SqlConnection
    {
        
log_amx("SQL: Could not connect to SQL database.")
        
    }
    new 
createinto[1002]
    
formatex(createinto1001"CREATE TABLE IF NOT EXISTS `levelstages` (")
    for (new 
i=0;i<sizeof(sqltables);i++)
    {
        
formatex(createinto1001"%s %s  ",createinto,sqltables[i])
        
    }
    
formatex(createinto1001"%s)",createinto)
    
SQL_ThreadQuery(g_SqlTuple,"QueryHandle"createinto
https://www.amxmodx.org/api/sqlx/SQL_MakeDbTuple

Watching it for couple hours straight today.. can't seem to understand what's going on

Last edited by DJBosma; 01-22-2023 at 16:12.
DJBosma is offline
DJBosma
Member
Join Date: Dec 2009
Old 01-22-2023 , 17:55   Re: SQLX using wrongly local ip instead of host provided
Reply With Quote #2

Solved it.
It seems until a remote host is allowed to connect, sqlx will select local ip.
DJBosma 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 18:41.


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