MySQL Threaded
#7

Quote:
Originally Posted by mike_1
Посмотреть сообщение
Thanks a lot for your helpful response but is it possible to make it without calling any function?
For example something like:
pawn Код:
new query[256];
format(query, sizeof(query), "SELECT field1, field2, field3 FROM table WHERE field4='Whatever'");
mysql_tquery(connectionHandle, query); //send the threaded query and load the results in the LoadData function, that has no parameters
new rows, fields;
cache_get_data(rows, fields, connectionHandle); //number of rows and fields
//we could have used rows = cache_num_rows(); too
if(rows) //if we found at least one result
{
    for(new i = 0; i < rows; i++) //looping through all the results
    {
    new field1, Float:field2, field3[16]; //we got one int, one float and one char
            field1 = cache_get_row_int(i, 0, connectionHandle);
            field2 = cache_get_row_float(i, 1, connectionHandle);
            cache_get_row(i, 2, field3, connectionHandle, sizeof(field3));
           
            //go ahead and use the variables however you want
        }
    }
        else
        {
                //no results
        }
I believe this is what you are trying to achieve.

https://sampforum.blast.hk/showthread.php?tid=548986

With inline you can have a function within a function. The tutorial above will show you how.
Reply


Messages In This Thread
MySQL Threaded - by mike_1 - 06.02.2015, 14:23
Re: MySQL Threaded - by HazardouS - 06.02.2015, 14:38
Re: MySQL Threaded - by mike_1 - 06.02.2015, 14:56
Re: MySQL Threaded - by HazardouS - 06.02.2015, 15:02
Re: MySQL Threaded - by Sime30 - 06.02.2015, 18:44
Re: MySQL Threaded - by HazardouS - 06.02.2015, 18:55
Re: MySQL Threaded - by Knappen - 06.02.2015, 19:03
Re: MySQL Threaded - by Sime30 - 06.02.2015, 19:30
Re: MySQL Threaded - by HazardouS - 06.02.2015, 19:35
Re: MySQL Threaded - by Sime30 - 06.02.2015, 19:41

Forum Jump:


Users browsing this thread: 1 Guest(s)