public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new haI = 1; haI < MAX_HOUSES; haI++)
{
new
Str[24],
hID;
mysql_query("SELECT * FROM `houses`");
mysql_store_result();
if(mysql_num_rows() > 0)
{
while(mysql_fetch_row(Str))
{
sscanf(Str, "p<|>is[128]", hID);
if(pickupid == HousePickup[hID])
{
GameTextForPlayer(playerid, "~w~Type ~r~/enter~w~ to go inside: ", 5000, 5);
}
iHos[haI][haID] = haI;
}
}
mysql_free_result();
}
return 1;
}
|
SQL is a whole other language (that's what the "L" stands for), so learn it like you would learn PAWN. Read the documentation, follow tutorials, study examples, THEN try apply it within PAWN. Far too often it seems that the attitude around here is that you learn PAWN and just stick some simple SQL on the end, but that shouldn't be how it is - they are both languages that need learning (and SQL is possibly more complex and extensive than PAWN so will take longer to learn).
|