08.09.2012, 08:27
Heya all.
Just quick question, cuz I somehow can not figure out answer for myself.
(Text - any text you want)
What it does?
It should return all records from 'Name' column, if there is 'Blah', for example:
It should return me OBlah, Blah1 and Blah2.
It works with my .db browser, but the question is, how to make %variable% readable for SAMP Server?
I tried to print it this way:
and
Yes \" were neccessary..
In both cases I've received only and only this:
.. but it should print
Anyone knows wheres the mistake?
Thanks a lot.
Greetz,
LetsOWN
SOLVED.
Solution:
Prints
like a charm.
Greetz,
LetsOWN
Just quick question, cuz I somehow can not figure out answer for myself.
pawn Код:
format(_qr,128,"Select Name from nameTable Where Name Like \"%%%s%%\"","Blah");
Код:
SQLite syntax: Select COLUMN From TABLE Where SOMETHING Like %Text%
What it does?
It should return all records from 'Name' column, if there is 'Blah', for example:
Код:
ID + Name + Money 1 | OBlah | 50 ----------------- 2 | Blah1 | 64 ------------------ 3 | lol | -666 ------------------ 4 | Blah2 | 5
It works with my .db browser, but the question is, how to make %variable% readable for SAMP Server?
I tried to print it this way:
pawn Код:
new Str[12];
format(Str,12,"\"%%%s%%\"", "Blah");
printf(Str);
pawn Код:
new Str[12];
format(Str,12,"\"%s%s%s\"","%","Blah","%");
printf(Str);
In both cases I've received only and only this:
Код:
"Blah"
Код:
"%Blah%"
Thanks a lot.
Greetz,
LetsOWN
SOLVED.
Solution:
pawn Код:
format(String,sizeof(String)," '%s%s%%'","%","Input");
Код:
'%Input%'
Greetz,
LetsOWN