Raised This Month: $ Target: $400
 0% 

SQL_TableExists help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-31-2009 , 18:38   Re: SQL_TableExists help
Reply With Quote #7

PHP Code:
bool:SQL_TableExists(szTable[])
{
    new 
Handle:SqlConnection SQL_Connect(gSqlTupleErrorCodegError511);
    
    if(
SqlConnection == Empty_Handle)
    {
        
set_fail_state(gError);
    }
    
    new 
Handle:Query;
    new 
iOutput 1;
    
    
Query SQL_PrepareQuery(SqlConnection"SELECT * from `%s`"szTable);
    
    if(!
SQL_Execute(Query))
    {
        
SQL_QueryError(QuerygError511);
        
        if(
containi(gError"#1146") != -1
        
|| containi(gError"No result set in this query!") != -1)
        {
            
iOutput 0;
        }
    }
    
    
SQL_FreeHandle(Query);
    
SQL_FreeHandle(SqlConnection);
    
    return 
bool:iOutput;

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
 



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 15:03.


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