11-02-2016, 03:23 AM
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
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