The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (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 refer url
#8
Ok. That makes sense. I will show you what to change and why it will help.

//I was assuming the user id was valid. Let's not do that.
Code:
$name = $db->query('SELECT username FROM users WHERE id = ?",array($ref))->first();
to

//make the query by itself
Code:
$nameQ = $db->query('SELECT username FROM users WHERE id = ?",array($ref));
//see if there are any results
Code:
$nameC = $nameQ->count();

if there are, grab the first (only) one
Code:
if($nameC > 0){
Code:
$name = $nameQ->first();
Code:
}

//Now, change the logic in your input class to only put in the value if there was one found when searching
//I'm going to share this as a pastebin link so I can space it out better without it being confusing.
https://pastebin.com/2CqLUa0F

If that isn't right, it's pretty close. I may have concatenated something wrong off the top of my head, but it's pretty close.
  Reply


Messages In This Thread
User refer url - by kingnath - 09-08-2017, 11:09 PM
User refer url - by mudmin - 09-09-2017, 12:24 PM
User refer url - by kingnath - 09-10-2017, 10:03 AM
User refer url - by mudmin - 09-10-2017, 12:16 PM
User refer url - by kingnath - 09-10-2017, 03:35 PM
User refer url - by mudmin - 09-10-2017, 04:40 PM
User refer url - by kingnath - 09-10-2017, 06:41 PM
User refer url - by mudmin - 09-10-2017, 08:22 PM
User refer url - by kingnath - 09-10-2017, 11:12 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)