Raised This Month: $ Target: $400
 0% 

[CSGO] sql morerows for * select


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pride95
Senior Member
Join Date: Aug 2015
Old 03-30-2017 , 12:13   [CSGO] sql morerows for * select
Reply With Quote #1

PHP Code:
public OnMapStart ()
{
    if(
db == INVALID_HANDLE)
        return;
    
    
decl String:query[256];

    
FormatEx(querysizeof(query), "SELECT * FROM sm_clear");
    
SQL_TQuery(dbSQLQueryFirstquery);

1.
PHP Code:
        if(!SQL_MoreRows(hndl))
        {
            
Format(querysizeof(query), "INSERT INTO sm_clear (unix, name) VALUES ('%i', '[error]')"GetTime());
        }
        else
        {
            while(
SQL_FetchRow(hndl))
            {
etcccc.
            }
        } 
2.

PHP Code:
        if(SQL_FetchRow(hndl))
            if(!
SQL_FetchInt(hndl0))
            {
                
Format(querysizeof(query), "INSERT INTO sm_clear (unix, name) VALUES ('%i', '[error]')"GetTime());
            }
            else
            {
                
etccccc
            

insert into is not executed if my table is empty. what i'm wrong?

Last edited by pride95; 03-30-2017 at 12:16.
pride95 is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 03-30-2017 , 12:32   Re: [CSGO] sql morerows for * select
Reply With Quote #2

You aren't executing the query string you formatted.
__________________

Last edited by Impact123; 03-30-2017 at 12:32.
Impact123 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 23:59.


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