![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
|
![]() Is this possible to do?
I have a table that contains the following columns in it: Month Day Year The output on the page is: December 15 2023 December 21 2023 December 02 2023 Is there a way that I can sort that data, if I'm pulling the date itself from 3 seperate columns using 3 echo statements? Or, a better way to include the date in form input to put it into the sql table itself making it sortable?
__________________
NOTHING TO SEE HERE |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 | |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,053
|
Quote:
Anyway, you can concatenate the 3 columns together to make a sortable date. Concat function: https://www.w3schools.com/sql/func_mysql_concat.asp .
__________________
All cookies cleared! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
|
Quote:
I'll take a look at that link, thanks ![]()
__________________
NOTHING TO SEE HERE |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,053
|
Quote:
Make a dropdown using the id as the key and the concatenated date as the display value. Then when they pick the date from the dropdown you can retrieve the data using the id. .
__________________
All cookies cleared! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
|
Quote:
__________________
NOTHING TO SEE HERE |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
making it rain
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,007
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,053
|
Quote:
Why not just use a date picker for that? <input type="date" https://www.w3schools.com/tags/att_input_type_date.asp Not sure why you would have the month, year, day tabled in 3 columns if you are using the date as the publishing date for the user to pick from. I assumed the table also had other data and you had just split your date up for some reason. .
__________________
All cookies cleared! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
|
Quote:
For example, if someone is out who is supposed to publish a document, or the document doesnt pass qc, they can edit the field and set a future date.
__________________
NOTHING TO SEE HERE |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,053
|
Quote:
.
__________________
All cookies cleared! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
|
Quote:
Maybe I'm not fully understanding what you are saying about storing the date? Doesnt that just do the same thing when stored? ![]()
__________________
NOTHING TO SEE HERE |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |||
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,053
|
Quote:
A date type field in the database is for storing a date. It is just one column, it does not split it into 3 pieces as you described. Quote:
Quote:
On your recipe add/edit screen you would have the date as an input field on the screen. On an add the field would be blank and the user would enter or pick the date for publishing. On the edit field, once the record was retrieved you would have the field populated with the current publish date and the user would be able to change it. .
__________________
All cookies cleared! |
|||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
|
Oh okay, I see what you're saying now, okay let me have a play about, that seems like it would actually be much simpler, thank you!
__________________
NOTHING TO SEE HERE |
![]() |
![]() ![]() ![]() ![]() ![]() |