Good morning, I've been with this error for a while and I'm unable to solve it to see if anyone can help me out, I'd really appreciate it!
$base=new PDO('mysql:host=localhost; dbname=pruebas', 'root', '');
$base->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$base=exec("SET CHARACTER SET UTF8");
The problematic line is this (18):
$registros=$base->query('SELECT * FROM datos_usuarios') >fetchAll(PDO::FETCH_OBJ);
and this is the error that gives me:
Fatal error: Call to a member function query () on string in C: \ wamp64 \ www \ php \ CRUD \ index.php on line 18
Thank you very much!