08.03.2012, 03:26
I have a simple house loading system, here is an adapted version with basic somments.
Код:
new query[300], rowstring[60]; mysql_query("SELECT * FROM `houses`"); new queryresult[300]; //This is the string we will use to store the data in, before we process it mysql_store_result(); if(mysql_num_rows() > 0) { //If there are any rows then.... while(mysql_fetch_row_format(queryresult, "|")) { //For each row of data mysql_fetch_field_row(queryresult, "FEILDNAME"); //Puts the string representation of 'FEILDNAME' into queryresult //Do somthing with the data mysql_fetch_field_row(queryresult, "FEILDINT"); //Puts the string representation of 'FEILDINT' into queryresult new AsInt = int:strval(queryresult); mysql_fetch_field_row(queryresult, "FEILDFLOAT"); //Puts the string representation of 'FEILDFLOAT' into queryresult new AsFloat = floatstr(queryresult); } } mysql_free_result(); // Free the results