* I AM MAD BECAUSE OF MYSQL
#1

Hello everybody,

I am using Stricken Kid's MySQL plugin.

No problem at all, everything's fine... except for one.

Код HTML:
stock GetDialogText(id, what[]){
	new query[128], value[512], whatisit[25];
	strcat(whatisit, what);
	format(query, sizeof(query), "SELECT * FROM `dialogs` WHERE dialogid='%d'", id);
	mysql_query(query);
	mysql_store_result();
	if(mysql_num_rows() != 0) {
	    while(mysql_fetch_row(query)){
	        mysql_fetch_field(what, value);
	        printf("WHAT: %s | VALUE: %s", whatisit, value);
	        mysql_free_result();
	        return value;
	    }
	}else printf("DIALOG '%d' DOESN'T EXIST!", id);
	mysql_free_result();
	return value;
}
So... as you can see, I use my own function "GetDialogText" which should do, that it takes something (string) from database. Well, it doesn't work as I want.

When I used "print" just to be sure that everything works, it shows me... "printf("WHAT: second_button | VALUE: Disconnect");"... It would be great, but "second_button" is last thing I want.

Код HTML:
ShowPlayerDialog(playerid, DG_REG, strval(GetDialogText(DG_REG, "style")), GetDialogText(DG_REG, "caption"), GetDialogText(DG_REG, "text"), GetDialogText(DG_REG, "first_button"), GetDialogText(DG_REG, "second_button"));
And what is worse, it drops a server...

Thank you very much for your help, if you do not understand to my explanation, then... try it again.

OH.. btw. I used commands /log and /reg to take some values (from another table), before I made this creature. And it normally worked and there is any different between that.
Reply


Messages In This Thread
Problem with mysql, return value; - by TheRohlikar - 04.12.2016, 20:10
Re: * I AM MAD BECAUSE OF MYSQL - by Yaa - 04.12.2016, 20:22
Re: * I AM MAD BECAUSE OF MYSQL - by TheRohlikar - 05.12.2016, 15:06
Re: * I AM MAD BECAUSE OF MYSQL - by Vince - 05.12.2016, 15:57
Re: * I AM MAD BECAUSE OF MYSQL - by TheRohlikar - 05.12.2016, 16:01
Re: * I AM MAD BECAUSE OF MYSQL - by TheRohlikar - 05.12.2016, 16:11
Re: * I AM MAD BECAUSE OF MYSQL - by TheRohlikar - 05.12.2016, 17:24
Re: * I AM MAD BECAUSE OF WHIRLPOOL - by TheRohlikar - 05.12.2016, 17:36
Re: * I AM MAD BECAUSE OF MYSQL - by TheRohlikar - 05.12.2016, 18:00
Re: * I AM MAD BECAUSE OF MYSQL - by TheRohlikar - 06.12.2016, 11:07

Forum Jump:


Users browsing this thread: 1 Guest(s)