Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/198261-saving-text/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/198261-saving-text/#findComment-1040279
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.