|
From: <a_g...@ya...> - 2003-06-11 23:03:30
|
This one works!!
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char sql_lt[128] = {'\0'};
char *prcampo = "hello";
char *prprocurar = "world";
sprintf(sql_lt,"select data,titulo,categoria,anotacao, \
ROWID from anot where %s like \'%%%s%%\';",prcampo,prprocurar);
puts(sql_lt);
return 0;
}/*main*/
Fernando_Conceição <fer...@te...> wrote:
Hi! In this:
sprintf(sql_lt,"select data,titulo,categoria,anotacao,ROWID from anot
where %s like '%s';",prcampo,prprocurar);
I get something like this:
select data,titulo,categoria,anotacao,ROWID from anot where titulo like
'mytitle';
But when I try place a % there is an error, or the value appears wrong
or I get a NULL string, by example, I need this output
select data,titulo,categoria,anotacao,ROWID from anot where titulo like
'%mytitle%';
I try to place one %, two %(like tell in libc reference), \% and nothing
gives what I want.
Can you show me how to do this?
Thanks.
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
Thanx and Regards
Avik Ghose
Catch all the cricket action. Download Yahoo! Score tracker |