Raised This Month: $ Target: $400
 0% 

SQL_MakeDbTuple port?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 01-29-2013 , 12:50   SQL_MakeDbTuple port?
Reply With Quote #1

How do you change it?

PHP Code:
static cell AMX_NATIVE_CALL SQL_MakeDbTuple(AMX *amxcell *params)
{
    
SQL_Connection *sql = new SQL_Connection;
    
int len;

    
char *host =  strdup(MF_GetAmxString(amxparams[1], 0, &len));

    
char *strchr(host':');
    if (
p)
    {
        
sql->port atoi(p+1);
        *
'\0';
    } else {
        
sql->port 0;
    }

    
sql->host host;
    
sql->user strdup(MF_GetAmxString(amxparams[2], 0, &len));
    
sql->pass strdup(MF_GetAmxString(amxparams[3], 0, &len));
    
sql->db strdup(MF_GetAmxString(amxparams[4], 0, &len));
    if (
params[0] / sizeof(cell) >= 5)
    {
        
sql->max_timeout static_cast<unsigned int>(params[5]);
    }

    
unsigned int num MakeHandle(sqlHandle_ConnectionFreeConnection);

    return 
num;

This looks like it should work, but it changes the host to default internal IP of the server when the port is added.

Edit: Nevermind, this is from the newer SQLx version (it's most likely bugged in the old one).

Last edited by Backstabnoob; 01-29-2013 at 12:52.
Backstabnoob is offline
 


Thread Tools
Display Modes

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 20:41.


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