The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/printthread.php(287) : eval()'d code 2 errorHandler->error
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



UserSpice
Retrieving data from database - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28)
+--- Forum: Modifications and Hackery (https://userspice.com/forums/forumdisplay.php?fid=29)
+--- Thread: Retrieving data from database (/showthread.php?tid=1288)

Pages: 1 2 3 4 5 6 7


RE: Retrieving data from database - LBC - 01-22-2019

https://pastebin.com/14zCJS0A

I altered it a bit since the attached image.


RE: Retrieving data from database - mudmin - 01-22-2019

Replace your entire valid until input with this...
https://pastebin.com/q1hTFLmJ


RE: Retrieving data from database - LBC - 01-22-2019

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


RE: Retrieving data from database - LBC - 01-22-2019

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


RE: Retrieving data from database - mudmin - 01-22-2019

Glad to help.
Sure. Just switch "Y-m-d" to "d-m-Y"


RE: Retrieving data from database - LBC - 01-22-2019

(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.


RE: Retrieving data from database - LBC - 03-26-2019

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?