these shitty sql warnings
#1

EDIT: Solved
Reply
#2

Show your
PHP код:
 new MySQLPipeline
Reply
#3

got these errors in this shity 'gates' table, not anywhere else :/
Reply
#4

MySQLPipeline should have a tag of DB: when it is declared.

Are you trying to convert MySQL to SQLite? Having "MySQL" in variable name but using sqlite functions.
Reply
#5

ye, konstantinos
i'm trying to convert SQLite to MySQL :P
Reply
#6

Do you see the trend here? whenever you use MySQLPipeline you see a tagmismatch warning, which well .. tells you it doesn't match the tag, so match it for god's sake(sqlite's tag for connection is DB).
Reply
#7

can you help me to conver this into mysql? ill do others myself..
Код:
    new Query[250],DBResult:Result,gateid = 0;
    for(new i = 0; i < MAX_GATES; i++)
    {
        format(Query, sizeof(Query),"SELECT * FROM gates WHERE ID = %d",i);
        Result = db_query(MySQLPipeline, Query);
        if(db_num_rows(Result))
        {
            format(Query, sizeof(Query),"UPDATE `gates` SET `ID` = '%d' WHERE `ID` = '%d'",gateid,i);
            db_query(MySQLPipeline, Query);
            gateid ++;
        }
    }
Reply
#8

Oh, it was the other way around.

I'm trying to figure out what your code is supposed to do - are you trying to set the IDs again without the missing numbers (perhaps those that were deleted)? Having set auto increment for a table is always good, so don't worry if you delete some of the rows and you see the IDs as the following: 1, 2, 6, 7, 10 etc.
Reply
#9

yes you're right konstantinos, so how can i fix those warnings?
Reply
#10

pawn Код:
// global:
new gateid;

// calling it once to fix them for now
new Query[50];
for (new i = 0; i < MAX_GATES; i++)
{
    format(Query, sizeof(Query), "SELECT * FROM gates WHERE ID = %d LIMIT 1", i);
    mysql_tquery(MySQLPipeline, Query, "OnGateLoad", "ii", gateid, i);

    gateid++;
}

forward OnGateLoad(gate_id, _i);
public OnGateLoad(gate_id, _i)
{
    if (cache_get_row_count())
    {
        new Query[45];
        format(Query, sizeof(Query), "UPDATE gates SET ID = %d WHERE ID = %d", gate_id, _i);
        mysql_tquery(MySQLPipeline, Query, "", "");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)