"fatal error: call to a member function fetchall() on a non-object in pdo" Code Answer

5

change:

mysql:localhost;widet_corp

to

mysql:host=localhost;dbname=widget_corp

also in your posted code:

$query = $pdo->query("select * from 'users'");

you have the table name inside single quotes. in mysql you should use a backtick instead for tables and columns.

    $query = $pdo->query("select * from `users`");
By Oliver Tynes on August 18 2022
Only authorized users can answer the Search term. Please sign in first, or register a free account.