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
user summit Record's
#1
im working on a user summit Record's and only they can see the Record and no one els

so im wondering is what is the beat way to how make this work i was thinking of using the users "email" or "ID"?? case username can change though i can make it that the username cant change

what is your input?

thanks,
sire
  Reply
#2
Definitely id. So every single record should have a column called user_id (associated with that user's id).

So when you are doing your query, it would be something like...

Code:
$query = $db->query("SELECT * FROM records WHERE user_id = ?",array($user->data()->id));
Code:
$results = $query->results();

Then
Code:
$results
would contain a full object/array of all records associated with that user id.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)