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
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Count by username
#5
I can't tell exactly what you're trying to do, but it looks like you're missing one key part...how to get the utilizator into the function. So, I see three things...

1. You want to put your custom functions in usersc/includes/custom_functions.php . This way they will not get overwritten when we do updates. I do fix things and add functionality in both helpers.php and us_helpers.php and I wouldn't want you to miss those changes.

2. You need to pass the username into the function so you can do your query, so it should look like this...

Code:
function fetchAllTask($utilizator) {

Then everything else looks good.

Then when you run the function, you just do
Code:
fetchAllTask($user->data()->username);

That should point you in the right direction.

3. I will say that it is probably better technique to base this on the user's id instead of their name. This will allow their data to remain intact if they change their username because the id will not change.
  Reply


Messages In This Thread
Count by username - by picassoo - 11-26-2016, 09:59 AM
Count by username - by mudmin - 11-26-2016, 03:01 PM
Count by username - by picassoo - 11-26-2016, 05:15 PM
Count by username - by picassoo - 11-26-2016, 05:29 PM
Count by username - by mudmin - 11-26-2016, 06:41 PM
Count by username - by picassoo - 11-26-2016, 11:24 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)