Sto provando ad inserire nel DB dei valori, $a e $b.

Vorrei fare così:

colonna:

a b
0 1
1 0
1 1
2 0
2 1
2 2
0 2
1 2
2 2


e così via, sto usando il ciclo while:

Codice PHP:
$a = -1;
    
$b = -1;
    
    while ( ( 
$a ) && ( $a ) ) {
        
            
$a++; $b++;
            
mysql_query ("INSERT INTO _map (ID, a, b) VALUES ($id$a$b)")  or die (mysql_error());
        
    } 
Purtroppo, while mi aggiunge sempre un valore e quindi diventa:

0 0
1 1
2 2
3 3

ect.

Ho provato ad inserire due while così:

Codice PHP:
while ( $a ) {
    
        
$a++
        
mysql_query ("INSERT INTO _map (ID, x, y) VALUES ($random_map$x$y)");  or die (mysql_error());
        while ( 
$b ) {
        
            
$b++
            
mysql_query ("INSERT INTO _map (ID, x, y) VALUES ($random_map$x$y)");  or die (mysql_error());
        }
        
        while ( ( 
$a ) && ( $b ) ) {
        
            
$a++; $b++;
            
mysql_query ("INSERT INTO _map (ID, x, y) VALUES ($random_map$x$y)");  or die (mysql_error());
        
        }
    
    } 
E mi da errore while, c'è qualche metodo che posso usare? GRAZIE!