Jump to content
  • 0

problema mysql


SaLiErY

Question

[pawn]public LoadSQLProperty()

{

new arrCoords[30][32];

new sql[400], row[512];

format(sql, sizeof(sql), "SELECT COUNT(*) FROM property");

mysql_query(sql);

//if (DEBUG) SQLLog(sql);

mysql_store_result();

mysql_fetch_row(row);

totalhouses = strval(row);

mysql_free_result();

for (new idx=0; idx<totalhouses; idx++)

{

    format(sql, sizeof(sql), "SELECT * FROM property WHERE id=%d", idx+1);

    mysql_query(sql);

//if (DEBUG) SQLLog(sql);

    mysql_store_result();

    if (mysql_num_rows() > 0)

{

        mysql_fetch_row_format(row, "|");

    explode(row, field, "|");

    mysql_free_result();

HouseInfo[idx][hEntrancex] = floatstr(arrCoords[1]);

HouseInfo[idx][hEntrancey] = floatstr(arrCoords[2]);

HouseInfo[idx][hEntrancez] = floatstr(arrCoords[3]);

HouseInfo[idx][hExitx] = floatstr(arrCoords[4]);

HouseInfo[idx][hExity] = floatstr(arrCoords[5]);

HouseInfo[idx][hExitz] = floatstr(arrCoords[6]);

HouseInfo[idx][hHealthx] = strval(arrCoords[7]);

HouseInfo[idx][hHealthy] = strval(arrCoords[8]);

HouseInfo[idx][hHealthz] = strval(arrCoords[9]);

HouseInfo[idx][hArmourx] = strval(arrCoords[10]);

HouseInfo[idx][hArmoury] = strval(arrCoords[11]);

HouseInfo[idx][hArmourz] = strval(arrCoords[12]);

strmid(HouseInfo[idx][hOwner], arrCoords[13], 0, strlen(arrCoords[13]), 255);

strmid(HouseInfo[idx][hDiscription], arrCoords[14], 0, strlen(arrCoords[14]), 255);

HouseInfo[idx][hValue] = strval(arrCoords[15]);

HouseInfo[idx][hHel] = strval(arrCoords[16]);

HouseInfo[idx][hArm] = strval(arrCoords[17]);

HouseInfo[idx][hInt] = strval(arrCoords[18]);

HouseInfo[idx][hLock] = strval(arrCoords[19]);

HouseInfo[idx][hOwned] = strval(arrCoords[20]);

HouseInfo[idx][hRooms] = strval(arrCoords[21]);

HouseInfo[idx][hRent] = strval(arrCoords[22]);

HouseInfo[idx][hRentabil] = strval(arrCoords[23]);

HouseInfo[idx][hTakings] = strval(arrCoords[24]);

HouseInfo[idx][hVec] = strval(arrCoords[25]);

          if(HouseInfo[idx][hVec] == 457)

{

HouseInfo[idx][hVec] = 411;

}

HouseInfo[idx][hVcol1] = strval(arrCoords[26]);

HouseInfo[idx][hVcol2] = strval(arrCoords[27]);

HouseInfo[idx][hDate] = strval(arrCoords[28]);

HouseInfo[idx][hLevel] = strval(arrCoords[29]);

printf("HouseInfo:%d Owner:%s hTakings %d hVec %d",idx,HouseInfo[idx][hOwner],HouseInfo[idx][hTakings],HouseInfo[idx][hVec]);

}

}

return 1;

}[/pawn]

deci nu imi citeste casele deci in baza de date am bagat casele help pls!!!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.