i8grand Posted April 12, 2010 Share Posted April 12, 2010 I am creating a Sudoku puzzle, and have so far managed to display the initial state of the puzzle with some numbers already given. I have created it so that when a user clicks on a blank cell a text box appears. I do not however know how to get this so, once the user enters a number the number is saved! I have a database that this is all linked to, the initial puzzle is an 81 string called initialGrid, and have another 81 string for the players new numbers (as well as the initial numbers) to be saved called playerStatus. My problem is making it so that when a user enters a number and then clicks on a save button, all the numbers are saved in playerStatus. Cells with no number are saved as a space (" "). Any help would be great thanks Quote Link to comment https://forums.phpfreaks.com/topic/198261-saving-text/ Share on other sites More sharing options...
oni-kun Posted April 12, 2010 Share Posted April 12, 2010 How about storing them in sessions instead of needlessly storing 81 values to the database per turn? Do what you wish to find if a block is false, isset, FALSE.. Quote Link to comment https://forums.phpfreaks.com/topic/198261-saving-text/#findComment-1040254 Share on other sites More sharing options...
i8grand Posted April 12, 2010 Author Share Posted April 12, 2010 I have it now so that i have a query to to fill in the table, but still do not know how to get the numbers from each cell and put them into one single string. $dbQuery = "INSERT INTO puzzlestatus VALUES (NULL, '$customerID', '$puzzle', */81 character string*/"; My only problem now is getting each of the numbers from the cells and putting them into a single string. All the cells have unique ids, e.g. top left cell is 0^0, and bottom right is 8^8. Is there any way I can input these into a single string using these?! Thanks Quote Link to comment https://forums.phpfreaks.com/topic/198261-saving-text/#findComment-1040279 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.