So instead of spending much time explaining i will just show you what the problem is, i have this method
public function lockCheck($string)
{
$Data = $this->getQuery("SELECT '$string' from settings where id=1");
if ($Data->num_rows==1)
{
while($Row = $Data->fetch_assoc())
{
if ($Row[$string]==1)
{
return true;
}
else
{
return false;
}
}
}
}
And its working perfectly fine if i dont have a parametar and just use 'locked' which is column from my table. But when i try using parametar $string it will always return false.
And this is how i call the method:
$ks->lockCheck("locked")
Any help will be appreciated.
') around$stringin"SELECT '$string' from settings where id=1"? That's invalid SQL.... It should be backticks (`) if anything'locked'literally, where id is 1