Hi, i need to make sudoku games in a website, i have database in mysql about the sudoku, each row contain sufficient information about one game.
+-----------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+----------------+
| game_no | mediumint(5) | NO | PRI | NULL | auto_increment |
| rating | varchar(14) | YES | | NULL | |
| row1 | varchar(20) | YES | | NULL | |
| row2 | varchar(20) | YES | | NULL | |
| row3 | varchar(20) | YES | | NULL | |
| row4 | varchar(20) | YES | | NULL | |
| row5 | varchar(20) | YES | | NULL | |
| row6 | varchar(20) | YES | | NULL | |
| row7 | varchar(20) | YES | | NULL | |
| row8 | varchar(20) | YES | | NULL | |
| row9 | varchar(20) | YES | | NULL | |
| game_row1 | varchar(20) | YES | | NULL | |
| game_row2 | varchar(20) | YES | | NULL | |
| game_row3 | varchar(20) | YES | | NULL | |
| game_row4 | varchar(20) | YES | | NULL | |
| game_row5 | varchar(20) | YES | | NULL | |
| game_row6 | varchar(20) | YES | | NULL | |
| game_row7 | varchar(20) | YES | | NULL | |
| game_row8 | varchar(20) | YES | | NULL | |
| game_row9 | varchar(20) | YES | | NULL | |
+-----------+--------------+------+-----+---------+----------------+
The columns labelled row1,row2, ... row9, are the 9 rows of the completed game. The 9 columns labelled game_row1, game_row2,... game_row9 show the rows of the game with numbers missing. The numbers in each row are separated by commas.
Here is an example of one game stored in the table.
Column Data
Name Value
================================
game_no 3
rating medium
row1 9,8,6,4,2,5,7,1,3
row2 3,7,5,6,8,1,4,2,9
row3 2,1,4,7,3,9,8,6,5
row4 4,6,1,8,7,3,5,9,2
row5 5,2,7,9,1,6,3,8,4
row6 8,9,3,2,5,4,1,7,6
row7 1,3,8,5,9,2,6,4,7
row8 6,5,2,1,4,7,9,3,8
row9 7,4,9,3,6,8,2,5,1
game_row1 0,8,0,0,0,0,0,1,3
game_row2 0,0,5,6,0,1,0,2,0
game_row3 0,0,4,0,3,0,8,0,0
game_row4 0,0,1,8,0,3,5,0,0
game_row5 0,0,0,0,0,0,0,0,0
game_row6 0,0,3,2,0,4,1,0,0
game_row7 0,0,8,0,9,0,6,0,0
game_row8 0,5,0,1,0,7,9,0,0
game_row9 7,4,0,0,0,0,0,5,0
anyway, i have another problem. how to make a sudoku grid table and put this database value inside it?
so let say after we select the level of the game that we want, the data will fill the sudoku table, but only if there is data on it. Not every box will be filled with the data. The empty box will have small input type=text for us to fill.
How can I do that?
thanks