PHP Code:
public OnMapStart ()
{
if(db == INVALID_HANDLE)
return;
decl String:query[256];
FormatEx(query, sizeof(query), "SELECT * FROM sm_clear");
SQL_TQuery(db, SQLQueryFirst, query);
}
1.
PHP Code:
if(!SQL_MoreRows(hndl))
{
Format(query, sizeof(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(hndl, 0))
{
Format(query, sizeof(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?