House loading with mysql.
#5

I know how works mysql,but i don't know how to do it ...

Код:
for(new house=0; house<pickups[1][HousePickup]+1; house++)
{
new Query[200];
format(Query, sizeof(Query), "SELECT * FROM houses WHERE `houseid` = '%d'",house);
mysql_query(Query);
mysql_store_result();
new savingstring[ 20 ];
while(!mysql_retrieve_row())
{
//If house pickup is not own.
houseDB[house][HouseLabel] = Create3DTextLabel("",-1,HousePickups[house][0],HousePickups[house][1],HousePickups[house][2],25, 0, 1);
format(text,sizeof(text),"House: %d\nPrice: %d",house,houseDB[house][nprice]);
Update3DTextLabelText(houseDB[house][HouseLabel],-1,text);
continue;
}
//If house pickup is belong for person.
mysql_fetch_field_row( houseDB[house][owner_name], "Owner");
mysql_fetch_field_row( savingstring, "Interior"); houseDB[house][ninterior] =  strval(savingstring);
mysql_fetch_field_row( savingstring, "HouseX"); houseDB[house][HouseX] = floatstr(savingstring);
mysql_fetch_field_row( savingstring, "HouseY"); houseDB[house][HouseY] = floatstr(savingstring);
mysql_fetch_field_row( savingstring, "HouseZ"); houseDB[house][HouseZ] = floatstr(savingstring);
houseDB[house][HouseLabel] = Create3DTextLabel("",-1,HousePickups[house][0],HousePickups[house][1],HousePickups[house][2],25, 0, 1);
format(file,sizeof(file),"House: %d\nPrice: %d\nOwner: %s",house,houseDB[house][nprice],houseDB[house][owner_name]);
Update3DTextLabelText(houseDB[house][HouseLabel],-1,file);
mysql_free_result();
}
}
But this not work...What can be wrong here?
Reply


Messages In This Thread
House loading with mysql. - by budelis - 16.10.2011, 07:44
Re: House loading with mysql. - by TheLazySloth - 16.10.2011, 07:48
Re: House loading with mysql. - by budelis - 16.10.2011, 08:59
Re: House loading with mysql. - by TheLazySloth - 16.10.2011, 09:19
Re: House loading with mysql. - by budelis - 16.10.2011, 10:43
Re: House loading with mysql. - by TheLazySloth - 16.10.2011, 10:44
Re: House loading with mysql. - by budelis - 16.10.2011, 11:13
Re: House loading with mysql. - by [HiC]TheKiller - 16.10.2011, 11:41
Re: House loading with mysql. - by budelis - 16.10.2011, 12:22

Forum Jump:


Users browsing this thread: 2 Guest(s)