MySQL Wiz Biz
#1

Hey guys, to whoever is reading this... I need urgent help regarding my script about MySQL

Goal: Obtain the user's name through their respective account IDs
Error: Public functions cannot return arrays
Request: Help in finding a work around to the problem but still preserves the initial goal of the function

Код HTML:
stock UserFromID(ID)
{
	new query[200];
	mysql_format(MySQL, query, sizeof(query), "SELECT `Username` FROM `Users` WHERE `ID` = %d LIMIT 0,1", ID);
	mysql_tquery(MySQL, query, "OnUserFromIDCheck", "i", ID);
	return 1;
}

forward OnUserFromIDCheck(ID);
public OnUserFromIDCheck(ID)
{
	new rows, fields, UserID[128];
	cache_get_data(rows, fields, MySQL);

	if(rows == 1)
	{
		cache_get_field_content(0, "Username", UserID, MySQL, sizeof(UserID));
	} else format(UserID, sizeof(UserID), "");
	return UserID;
}
Thank you in advance!
Reply


Messages In This Thread
MySQL Wiz Biz - by DeathKing - 22.03.2016, 07:59
Re: MySQL Wiz Biz - by SickAttack - 22.03.2016, 08:19
Re: MySQL Wiz Biz - by Sabur - 22.03.2016, 08:35
Re: MySQL Wiz Biz - by SickAttack - 22.03.2016, 08:39
Re: MySQL Wiz Biz - by DeathKing - 22.03.2016, 09:09
Re: MySQL Wiz Biz - by introzen - 22.03.2016, 09:20
Re: MySQL Wiz Biz - by jlalt - 22.03.2016, 09:26
Re: MySQL Wiz Biz - by DeathKing - 22.03.2016, 10:14

Forum Jump:


Users browsing this thread: 2 Guest(s)