Dialog and mySQL
#1

Good after noon, I have a little question concerning the Dialogs and mySQL queries.


I want to display last 5-6 911 calls in one dialog, but I don't understand how to do it.


That's the code when the 911 call is inserted into database:

pawn Код:
new query[1024];
        format(query, sizeof(query), "INSERT INTO `911Calls` (`Caller`, `Number`, `Location`, `Situation`, `Taken`) VALUES ('%s', '%d', '%s', '%s', '0');",turner, PlayerInfo[playerid][pPhoneNumber], PlayerCrimeLocation[playerid], PlayerCrimeReport[playerid]);
        mysql_query(query);
Reply
#2

Quote:

SELECT * FROM `911Calls` ORDER BY id DESC LIMIT 5

That's pretty much it. Use threaded queries for the love of God
Reply
#3

The problem is how to display the data. Is something similar to data displaying from PHP?
Reply
#4

Well, not quite, you don't have an automatically created array/ORM. You have to fetch each field individually, then create string, and then display stuff, either via SendClientMessage, textdraws or dialog.
Reply
#5

Hm, I thinked about this some time ago, but I thinked too about a 'shorter' solution. Thank you anyway

REP +
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)