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
v.5 -- Didn't know where else to post this so...
#15
I am on my phone so please forgive any typos or brief explanations. If you are expecting only one result you want to use First so you don't return a full object that you have to Loop through to get to the right result. If you don't know how many results you're going to get it then you can use results and loop through them.

I think what I would do is not try to concatenate your query right in the middle and I would also find the results to protect against sql injections and things like that.
$url = "users/".$current_page_url

$query = $db->query("SELECT id FROM pages WHERE page = ?",array($url));

That should do the trick or come pretty close to it
  Reply


Messages In This Thread
v.5 -- Didn't know where else to post this so... - by dan - 11-02-2016, 03:23 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)