SA-MP Forums Archive
MySQL and sscanf not working good together [Reply only if you know about those 2] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL and sscanf not working good together [Reply only if you know about those 2] (/showthread.php?tid=406725)



MySQL and sscanf not working good together [Reply only if you know about those 2] - [MG]Dimi - 11.01.2013

PHP код:
printf("Line: %s",line);
sscanf(line,"p<|>ds[128]",Info[playerid][MsgStatus],Message[playerid]); 
Ok, I got data I need from MySQL, to be sure I have printed string line. Now when I use sscanf to split it variables don't hold right values. I'm sure it's something really stupid. I'm breaking my head 2 days already.
I have printed Info[playerid][MsgStatus] and Message[playerid] after sscanf line. Below is code from server_log.txt.

Код:
[15:15:17] Line: 1|adasdasda
[15:15:17] Msg Status: 0
[15:15:17] Message:



Re: MySQL and sscanf not working good together [Reply only if you know about those 2] - [MG]Dimi - 12.01.2013

Nobody knows?


Re: MySQL and sscanf not working good together [Reply only if you know about those 2] - [HK]Ryder[AN] - 12.01.2013

Can you show where you SAVE those 2 values?


Re: MySQL and sscanf not working good together [Reply only if you know about those 2] - Luis- - 12.01.2013

You should use R7, it's much easier.


Re: MySQL and sscanf not working good together [Reply only if you know about those 2] - [MG]Dimi - 12.01.2013

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
Can you show where you SAVE those 2 values?
I don't save them anywhere. they are entered through website or direct access to Database through phpmyadmin.

@-Luis Maybe but MySQL isn't problem. You can clearly see that string line has values it should. Thing is that sscanf doesn't separate them good.