I am trying to write some functions in PHP but just to my surprise i keep getting 500 internal server error.
Here is my code:
<?php
class Surveuillance{
public $id;
public $info;
public function __construct($id)
{
$this->id = App::escape($id);
$this->info = App::sql()->query_row("SELECT * FROM userdb");
}
public function display_info()
{
$id = $this->info->id
$right = App::sql()->query_row("SELECT * FROM camera WHERE id = '$id");
return $right;
}
}
Then i did this after importing it in surveillance.php
There is a typo in your code: Surveuillance vs Surveillance
I don't know what kind of code it is as it seems a bit odd to me. But display_info() is also not a static method so you cannot call it like this: Surveillance::display_info(). You can only do it like this:
$surveillance = new Surveillance($id);
$surveillance->display_info()
And for the rest, your 500 error should give you some more information on what is going wrong in your code. If you do not see it on your screen the error log should give you a more detailed description of what is going wrong.