• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Retrieving data from database
#61
https://pastebin.com/14zCJS0A

I altered it a bit since the attached image.
  Reply
#62
Replace your entire valid until input with this...
https://pastebin.com/q1hTFLmJ
  Reply
#63
hmm...somehow it doesn't want to update the date of the validity column any more.
No idea why... It did before Sad

I'll try to fix that, your code will probably work then.

I have entered the date manually into the validity column of that user. It shows up in the form now...but no expiry date is displayed I'm afraid.

(01-22-2019, 02:12 PM)LBC Wrote: hmm...somehow it doesn't want to update the date of the validity column any more.
No idea why... It did before Sad

I'll try to fix that, your code will probably work then.

I have entered the date manually into the validity column of that user. It shows up in the form now...but no expiry date is displayed I'm afraid.

After removing the entire bit you posted on pastebin....I can update the validity column again. Isn't that weird?

It does work with the old code though. This one:

<?php
if($user->data()->membership == '5cc'){
$length = 6;
}elseif($user->data()->membership =='10cc'){
$length = 12;
}
if(isset($length)){
echo date('Y-m-d', strtotime("+".$length." months", strtotime($user->data()->validity)));
}
?>

It just does not seem to work inside a label. Hah! Who knew! Tongue
  Reply
#64
Any thoughts on how to convert the output date to dd-mm-yyyy?

Thanks a lot for all your troubles today Mudmin. I very much appreciate it.
I've learned a lot today  Smile
  Reply
#65
Glad to help.
Sure. Just switch "Y-m-d" to "d-m-Y"
  Reply
#66
(01-22-2019, 03:28 PM)mudmin Wrote: Glad to help.
Sure. Just switch "Y-m-d" to "d-m-Y"

yes...i did that for the output...but that is not possible for the validity dates as there is no yyyy-dd-mm anywhere.

I need to put some converting code somewhere.....but i dont know where or what.
  Reply
#67
Hello!

Is it possible to somehow use this code to display the names of the people who have booked at a certain day?
Like, displaying the first and last names of everyone who booked on Monday and Wednesday and Friday and Sunday?
The days are stored in either the regular_days or random_days in the users table.

Or would I have to have a completely different kind of function for this?
Do you have any tips?
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)