Код:
format(sql, sizeof(sql), "SELECT sender, sendername, mail FROM mail WHERE recipient='%d'", pInfo[playerid][pCharacter]);
mysql_query(sql);
mysql_store_result();
while(mysql_retrieve_row())
{
mysql_fetch_row_format(data, "|");
SendClientMessage(playerid, COLOR_GREY, data); // Testing
}
Can somebody tell me what im doing wrong? Im trying to complete my mail system. Therefore i need to load the mails the user received from a database. The query seems to work, at least phpmyadmin outputs the correct rows...
which seems correct. Instead of using SendClientMessage i plan to use sscanf to split the string, but first i need to get the mysql part to work. So is there anybody who can tell me, what im doing wrong?
EDIT: The Server just doesnt output anything, so the while loop isnt called at all
EDIT2: Found the mistake, my sql string was to short. But now it only outputs one message, altough there are two rows in my sql database. It also outputs 2 rows in phpmyadmin with the same sql command. What am i doing wrong now?
EDIT3: If i use mysql_num_rows it outputs 2, which is correct. So why does the while loop only run once.