26.03.2015, 16:12
I'm testing it on a local server, on Windows.
CREATE TABLE IF NOT EXISTS graffiti_colours ( id INT AUTO_INCREMENT NOT NULL, name VARCHAR(32) NOT NULL, argb VARCHAR(8) NOT NULL, PRIMARY KEY(id) ) ENGINE=INNODB DEFAULT CHARSET cp1257 COLLATE=cp1257_bin;
SELECT id, CONVERT(CONV(argb, 16, 10), SIGNED) AS argb FROM graffiti_colours WHERE name = '%e'
cache_get_field_content_int(0, "argb");
20:47:45 cache_get_field_content_int OK row: 0, field_name: "argb", connection: 1 20:47:45 CMySQLResult::GetRowDataByName OK row: '0', field: "argb", data: "4294901760" 20:47:45 cache_get_field_content_int ERROR invalid datatype
//In some public
new qwery[300];
format(qwery, sizeof(qwery), "SELECT `lvl` FROM `admins` WHERE BINARY `Nick` = '%s'", GN(playerid));
mysql_function_query(MySQL, qwery, true, "OnAdminQueryFinished", "i", playerid);
SendClientMessage(playerid, -1, qwery);
public OnAdminQueryFinished(playerid)
{
new lvl = cache_get_row_int(0,0);
SendMes(playerid, -1, "%i", lvl);
if(lvl > 0)
{
//Don't exec
}
else
{
//exec
}
return 0;
}
[15:09:17] SELECT `lvl` FROM `admins` WHERE BINARY `Nick` = 'Эраст_Фандорин' [15:09:17] 0
public OnAdminQueryFinished(playerid)
{
// first we've to check whether there are any results, if yes, it will simply continue.. otherwise, nothing will happen, you could add an else statement to the following if statement if you wanted to do something about when there are no row existing rows.
if(cache_get_row_count())
{
new lvl = cache_get_row_int(0,0);
SendMes(playerid, -1, "%i", lvl);
if(lvl > 0)
{
//Don't exec
}
else
{
//exec
}
}
return true; // returning true will clear out this callback's cache.
}
Hi, how can if find if a specific word in a string im providing matches a row i have?
i.e: string = "Hello World" Table: Code:
... Something more like the strfind function: if (~strfind("World", "Hello Wrold", true)) |
SELECT * FROM tbl_name WHERE tbl_field LIKE "% foo %";
Hello BlueG.
Some kind of issue here... SA-MP server 0.3z R4 with MySQL R39-3, running on Debian x64. PHP Code:
PHP Code:
They sends: Code:
[15:09:17] SELECT `lvl` FROM `admins` WHERE BINARY `Nick` = 'Эраст_Фандорин' [15:09:17] 0 Here is a point: I'm adding some symbols from Russian alphabet in my Query (`Nick` = 'Эраст_Фандорин'), but it works just fine with phpmyadmin. UPD: works fine without Russian symbols...can you fix it, please? |
No, I just don't know how to use threading.
If anyone does know how to use threading, could you please make a topic on how to use it with the newest release or if there already is a topic please can you link me? |