Hi, probably a fairly simple answer to this as i'm certain lots of people have run into it, yet i can't find a solution by searching....
I have a mysql database. the default date format it uses is yyyy-mm-dd. My client is in England, and they are used to having mm-dd-yy. I have used the dateFormat property to successfully display the date the way i want when it's selected, and i've used strtotime in php to re-convert it back to the correct format when saving to the mysql database. One small problem though : when i click the submit button to update the database form, it all works, but when the page refreshes the textbox shows the date in the default yyy-mm-dd format again. it only returns to the display format i want once i click on the datepicker and select the date again
specifically, I have a sortable with 16 spaces. in each is some text. It initially starts out with the data in the same order it is in the database. I want to make it so that after the user sorts the sortable blocks the way he wants, he can click "save" and the page rearranges the data in the database in the new order he's specified. so if previously for example the database had :
field 1 = "apples"
field 2 = "oranges"
field 3 = "pears"
field 4 = "bananas"
and so on, and the user rearranged the order to be (on the screen visually) : apples, bananas, oranges, pears, then my desired end result when "save" was pressed would be to save this in the database :
field 1 = "apples"
field 2 = "bananas"
field 3 = "oranges"
field 4 = "pears"
essentially i'm trying to make a menial data manipulation visual and intuitive. I could do this very easily in a traditional language by just doing the following in pseudo code :
- load the data in the order it appears on screen into variables;
- reassign the database fields accordingly by building the SQL necessary
- make the database call using a POST
where I'm falling down is how to do this in practice, and whether it can all be done using jquery or ajax or something else. I'm a php person but this isn't server side so my limitations are exposed lol....
what's the best way to do this? thru jquery directly, or must it be done in Ajax? (i have very little ajax knowledge) I am planning to fix this gap in my knowledge but that won't happen soon enough to solve this problem, so for the short term i need to figure out how to get this task done. help!