PHP and Databases
Connecting PHP to MySQL or PostgreSQL with PDO: prepared statements, fetching, transactions, error handling and the queries that make pages slow.
Try: python lists, javascript functions, syntax error, first project
Server-side PHP explained simply — forms, sessions, databases and the errors that stop beginners. Practical examples you can run on a local server.
23 guides
Connecting PHP to MySQL or PostgreSQL with PDO: prepared statements, fetching, transactions, error handling and the queries that make pages slow.
The command line, the web server and WordPress can each be running a different PHP. How to check all three, why they…
Send data between JavaScript and PHP without reloading the page: fetch, JSON endpoints, form handling, error responses and CSRF protection.
Composer installs PHP packages and loads their classes automatically. What it does, the five commands you need, what composer.json and the lock…
Take PHP from loose files in a web root to a real project: Composer, autoloading, a front controller, routing, PDO, templates and…
You used an array where PHP expected a string: in echo, concatenation, a database query or a function argument. Where the warning…
Where PHP applications actually spend their time, how to measure before you optimise, and the fixes that matter: OPcache, N+1 queries, indexes…
Call a REST API from PHP with cURL or Guzzle, handle JSON and errors properly, add authentication, and build a small API…
PDO is the standard way to talk to a database from PHP. Connecting, prepared statements that stop SQL injection, fetching rows, transactions…
What PHP is, how it differs from JavaScript, how a request becomes a page, and your first working script — with the…
PHP 7 has been end-of-life since 2022. What PHP 8 changed in the language, what breaks when you move, why the upgrade…
A blank white page and no error anywhere is PHP hiding the problem on purpose. Here is how to see errors in…
Related topics
The fastest way to improve is to read one guide, then build the thing it describes. Start with the basics, or jump straight to a project.