20.10.2012, 06:00
PHP код:
new var[2];
forward OnPlayerSelected( );
public OnPlayerSelected( )
{
new rows, fields;
cache_get_data( rows, fields ); // fetch how many results, and fields the query returned.
if( rows ) { // if there are rows
new content[ 20 ]; // new string to hold the values from the database
for( new row = 0; row < rows; row++ ) { // loop through all the rows, like looping through a file almost
cache_get_field_content( row, "Field1", content ); // get Field1 and store it into content
var[ 0 ] = strval( content ); // self explanatory
cache_get_field_content(row, "Field2", content); // get Field2 and store it into content
var[ 1 ] = strval( content ); // same thing
}
}
return true;
}