Raised This Month: $ Target: $400
 0% 

MYSQL Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KillLikoe
BANNED
Join Date: Nov 2010
Location: Paraguay
Old 11-09-2011 , 16:42   MYSQL Problem
Reply With Quote #1

Well, yesterday i begun to use mysql on my server and i dont understand very well about it, so this is my problem
PHP Code:
 // Connect to SQL
    
new Handle:SqlConnect SQL_Connect(g_hTupleErrorCodeg_Error511)
    
    
// Create Handle
    
new Handle:Query
    Query 
SQL_PrepareQuery(SqlConnect"SELECT * FROM `cuentas` WHERE (`Nombre` = '%s')"cuenta[id]) --> line 393
    
    
// Query Execute ?
    
if (SQL_Execute(Query))
    {
        if (!
SQL_NumResults(Query))
        {        
            
            
crear_contrasenia(id)        
            
            
// Connection Closed
            
SQL_FreeHandle(Query)
            
SQL_FreeHandle(SqlConnect)
            
            return 
PLUGIN_HANDLED;
        }
        else
        {
            
mensajes_cuenta(id1)
            
client_print(idprint_center"Esa cuenta ya existe!")            
            
            
show_menu_cuenta(id)
            
            return 
PLUGIN_HANDLED;
        }
    } 
and in the console of the server
PHP Code:
L 11/09/2011 18:32:48: [MySQLInvalid database handle0
L 11
/09/2011 18:32:48: [AMXXDisplaying debug trace (plugin "guardado_sql.amxx")
L 11/09/2011 18:32:48: [AMXXRun time error 10native error (native "SQL_PrepareQuery")
L 11/09/2011 18:32:48: [AMXX]    [0guardado_sql.sma::filtro_crear_cuenta (line 393
KillLikoe is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 11-09-2011 , 17:05   Re: MYSQL Problem
Reply With Quote #2

If you are using sqlx, then you should do this with SQL_ThreadQuery. Anyway try this:
PHP Code:
    // Connect to SQL
    
new Handle:SqlConnect SQL_Connect(g_hTupleErrorCodeg_Error511)
    if(
SqlConnect == Empty_Handle)
    {
        
log_amx("SQL Error: %s"g_Error)
        return 
PLUGIN_HANDLED;
    }
    
// Create Handle
    
new Handle:Query
    Query 
SQL_PrepareQuery(SqlConnect"SELECT * FROM `cuentas` WHERE (`Nombre` = '%s')"cuenta[id]) //--> line 393
    
    // Query Execute ?
    
if (SQL_Execute(Query))
    {
        if (!
SQL_NumResults(Query))
        {        
            
crear_contrasenia(id)        
        }
        else
        {
            
mensajes_cuenta(id1)
            
client_print(idprint_center"Esa cuenta ya existe!")            
            
show_menu_cuenta(id)
        }
        
SQL_FreeHandle(Query)
        
SQL_FreeHandle(SqlConnect)
        return 
PLUGIN_HANDLED;
    }  
    
SQL_FreeHandle(SqlConnect
__________________
Impossible is Nothing
Sylwester is offline
KillLikoe
BANNED
Join Date: Nov 2010
Location: Paraguay
Old 11-09-2011 , 17:08   Re: MYSQL Problem
Reply With Quote #3

you are a genius man ! , and other thing someone know how to fix this problem ?
Code:
 
L 11/09/2011 - 21:21:21: [guardado_sql.amxx] SQL Error: Access denied for user 'mysql55'@'localhost' (using password: YES)

Last edited by KillLikoe; 11-09-2011 at 19:35.
KillLikoe 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 14:21.


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