MySQL help?
#5

Why read every field as a string, to convert it to a integer or float afterwards before it can be stored in a variable?
You should set your columns to the correct type and read it directly.
Cleaner and shorter code will be your result.

PHP код:
CampInfo[extraid][i][cOwner] = cache_get_field_content_int(i,  "Owner"MainPipeline);
CampInfo[extraid][i][cID] = cache_get_field_content_int(i"id"MainPipeline);
if(
CampInfo[extraid][i][cID] != 0)
{
    
CampInfo[extraid][i][cPosition][0] = cache_get_field_content_float(i,  "cPosX"MainPipeline);
    
CampInfo[extraid][i][cPosition][1] = cache_get_field_content_float(i,  "cPosY"MainPipeline);
    
CampInfo[extraid][i][cPosition][2] = cache_get_field_content_float(i,  "cPosZ"MainPipeline);
    
CampInfo[extraid][i][cPosition][3] = cache_get_field_content_float(i,  "cPosAngle"MainPipeline);
    
CampInfo[extraid][i][cLocked] = cache_get_field_content_int(i,  "cLock"MainPipeline);
    
CampInfo[extraid][i][cVW] = cache_get_field_content_int(i,  "cVirtualWorld"MainPipeline); 
Isn't this easier to read and follow?
Reply


Messages In This Thread
MySQL help? - by Hellman92 - 29.01.2016, 10:57
Re: MySQL help? - by Shinja - 29.01.2016, 11:17
Re: MySQL help? - by Hellman92 - 29.01.2016, 11:28
Re: MySQL help? - by RoastBeef - 29.01.2016, 11:52
Re: MySQL help? - by AmigaBlizzard - 29.01.2016, 11:59

Forum Jump:


Users browsing this thread: 1 Guest(s)