Well, if you don’t open a database connection called $pdo, how can you expect to run a query on a non-existent connection?
The tutorial expects that you read and absorb what it says. When it shows that example, it is showing how to execute a query, and probably doesn’t expect to have to point out that first you must connect to the database.
By the time you get to that example on the site, you should already have read the section before it, detailing how to open the connection. If your other query is working, you already have that bit.
If you already have a connection called $conn, just use that instead.
(I’m not saying that site is perfect, I hadn’t read any of it until earlier.)
What happened:
I made a php which send the login data, and that works well (now).
To prepare for showing the contents of a table I tried that example.
But I tried perhaps in the wrong script.I will check again