Welcome Guest, Not a member yet? Register   Sign In
convert value from routes/uri to string
#1

Controller
PHP Code:
public function verification($activation$email)
{
    
$user $this->model->user('user_activation'$activation);


Model
PHP Code:
public function user($key$value)
{
 
   return $this->db->query("
       SELECT *
         FROM users
         WHERE 
$key = $value // The problem here
     "
)->row();



The error message is directed to $ value, the value of $ activation is taken from routes / url.
I try to use single quotes so that it becomes '$ value'. and the results are correct.
my question is whether using single quotes doesn't matter? or is there a better way?
Reply


Messages In This Thread
convert value from routes/uri to string - by DELE - 04-13-2019, 01:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB