Help with mysql
#2

You need to loop trough all the rows.

Since you are using mysql_fetch_field_row you need to use mysql_retrieve_row() to move internal row pointer to the next row

Код:
if(mysql_num_rows() > 0) {
	while(mysql_retrieve_row())
	{
		mysql_fetch_field_row(BannedBy, "Admin");
		mysql_fetch_field_row(BannedReason, "Reason");
		mysql_fetch_field_row(savingstring, "Day"); BannedDay = strval(savingstring);
		mysql_fetch_field_row(savingstring, "Month"); BannedMonth = strval(savingstring);
		mysql_fetch_field_row(savingstring, "Year"); BannedYear = strval(savingstring);
		mysql_fetch_field_row(savingstring, "Hour"); BannedHour = strval(savingstring);
		mysql_fetch_field_row(savingstring, "Minute"); BannedMinute = strval(savingstring);
		mysql_fetch_field_row(BannedName, "Name");
		mysql_fetch_field_row(BannedIP, "IP");

		format(cQuery, sizeof(cQuery),"%s banned %s(%s) for %s [%02d/%02d/%02d - %02d:%02d]\n",
			BannedBy,
			BannedName,
			BannedIP,
			BannedReason,
			BannedDay,
			BannedMonth,
			BannedYear,
			BannedHour,
			BannedMinute
		);
		SendClientMessage(playerid, COLOR_YELLOW, cQuery);
	}
} else {
	SendClientMessage(playerid, COLOR_RED, "No bans found.");
}
Reply


Messages In This Thread
Help with mysql - by s4kuL - 20.12.2015, 10:42
Re: Help with mysql - by Antonio144 - 20.12.2015, 11:20
Re: Help with mysql - by s4kuL - 20.12.2015, 11:48

Forum Jump:


Users browsing this thread: 1 Guest(s)