• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Best way to load data from database (MySQL r41)
#3
Good question.. Is there something else I can do to improve it?



Code:
function loadDealerShip( ) { ? ? new DS_Models = cache_num_rows( ); ? ? if( DS_Models == 0 ) return print( "Loaded models: no rows detected" ); ? ? for( new i, j = DS_Models; i != j; ) { ? ? ? ? cache_get_value_name_int( i, "ID", dsVariable[ i ][ dsID ] ); ? ? ? ? cache_get_value_name_int( i, "Model", dsVariable[ i ][ dsModel ] ); ? ? ? ? cache_get_value_name_int( i, "Stock", dsVariable[ i ][ dsStock ] ); ? ? ? ? cache_get_value_name_int( i, "Speed", dsVariable[ i ][ dsSpeed ] ); ? ? ? ? cache_get_value_name_int( i, "Price", dsVariable[ i ][ dsPrice ] ); ? ? ? ? cache_get_value_name_int( i, "Type", dsVariable[ i ][ dsType ] ); ? ? ? ? cache_get_value_name( i, "Car", dsVariable[ i ][ dsName ] ); ? ? } printf( "Loaded models: %d", DS_Models ); return true; }
  Reply


Messages In This Thread
RE: Best way to load data from database (MySQL r41) - by shane adevaratu - 2020-12-18, 11:26 AM