I am new to coding, trying to create a simple registration form using php and mysql ..but this error I dont know Why it says the table is read only can somebody help me fix it
This is the error
Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1036 Table 'tablename' is read only in C:\xampp\htdocs\Laravel\Project\public\classes\DB.php:15 Stack trace: #0 C:\xampp\htdocs\Laravel\Project\public\classes\DB.php(15): PDOStatement->execute(Array) #1 C:\xampp\htdocs\Laravel\Project\public\create-account.php(14): DB::query('INSERT INTO sig...', Array) #2 {main} thrown in C:\xampp\htdocs\Laravel\Boss\public\classes\DB.php on line 15
and this the DB.php
file
class DB{
private static function connect(){
$pdo=new pdo('mysql:host=127.0.0.1;dbname=boss;charset=utf8','root','');
$pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
return $pdo;
}
public static function query($query,$params=array()){
$statement=self::connect()->prepare($query);
$statement->execute($params);
//$data = $statement->fetchAll();
//return data;
}
}