Einzelnen Beitrag anzeigen

marabu

Registriert seit: 6. Apr 2005
10.109 Beiträge
 
#4

Re: MySQL: Update einer 2d-Matrix klappt nicht...

  Alt 9. Mai 2005, 21:07
Hallo Chris,

ich hätte etwa folgenden Code erwartet:

Delphi-Quellcode:
// Geschmacksmuster - ungetestet!
const
  sql = 'UPDATE MAP SET texture = %d WHERE row = %d AND col = %d';
var
  i, iRow, iCol: integer;
  sQuery: string;
begin
  for iRow := 1 to 127 do
    for iCol := 0 to 127 do
      if map[iRow, iCol] <> mapold[iRow, iCol] then begin
        sQuery := Format(sql, [map[iRow, iCol], iRow, iCol]);
        // mysql_real_query(_myCon, sQuery, Length(sQuery)); // hier musst du noch korrigieren
      end;
end;
Grüße vom marabu
  Mit Zitat antworten Zitat