The first CRUD app I built was a student record system for a small tutorial centre in Port Harcourt. It had one table, four pages, and no design. The owner used it for three years. That is the bar for a first project: not impressive, just useful.
CRUD sounds like a big term. It means create, read, update, delete. A notebook where you can write a name, see the names, correct a spelling, and cross one out. Every app you use, from WhatsApp to your bank, is some version of that.
Pick something with one table
Do not build a school management system for your first app. You will drown in students, classes, fees, terms, and parents, and you will not finish. Pick something that fits in one table.
Good first projects: a contact book, a book list, a small inventory for a shop, a list of church members, a personal expense log. Bad first projects: anything with login, payments, roles, or file uploads. Those are second projects.
For this article I will use a contact book. Name, phone number, email, and a note. That is it.
Set up the tools without fighting them
On Windows, XAMPP is the fastest way to get PHP and MySQL running. Install it, open the control panel, and start Apache and MySQL. Then open your browser and go to localhost. If you see the XAMPP dashboard, you are ready.
Two things go wrong here almost every time. Apache will not start because port 80 is taken, usually by Skype or a Windows service. Change Apache to port 8080 in the config, then use localhost:8080. The other is that MySQL starts and immediately stops because another MySQL install is already running. Stop the other one or change the port.
Put your project folder inside htdocs. That is the folder XAMPP serves. Create a folder called contacts, and inside it an index.php file. Open localhost/contacts and you should see whatever you put in that file.
Create the table before the screens
Open phpMyAdmin from the XAMPP dashboard, create a database called contacts_db, and run this in the SQL tab:
CREATE TABLE contacts (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), phone VARCHAR(20), email VARCHAR(100), note TEXT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
Then connect to it from PHP with mysqli. Keep the connection in one file, db.php, and include it everywhere. When your password changes later, you change one line instead of twelve.
Do not put the database password in a public GitHub repo. I have seen this happen to three students. Use a config file that you do not commit, even for a practice project. Build the habit early.
Build the four screens in order
Start with read, not create. Make a page that lists whatever is in the table, even if the table is empty. This proves the connection works before you add complexity.
Then create. A form with four inputs, a submit button, and a PHP block that inserts the values. Use prepared statements, not string concatenation. The first time someone types an apostrophe in a name like O'Brien, your query will break, and that is the gentle version of the lesson.
Then edit. Put an edit link on each row that loads the record into a form, and update it on submit. Then delete, with a confirmation. Four screens, one table, done.
Keep the design ugly for now. A plain HTML table with default fonts is fine. If you spend day one on colors, you are avoiding the part that teaches you.
The mistakes that cost beginners weeks
These are the three I see most often:
- Mixing up GET and POST. Forms that change data should post. Links that only show a page can get. When you refresh after a POST, the browser may resubmit the form, and you will wonder why you have duplicate contacts.
- Not escaping output. If a name contains HTML, it will render as HTML. Use htmlspecialchars when printing user data. It takes one function and prevents a class of problems you are not ready to debug.
- Building on localhost forever. The app is not done until someone else can open it. Put it on a cheap shared host or a small VPS. Fixing the things that break when you move it is the most useful week of the project.
My own first attempt failed because I had four copies of db.php with four different passwords. I kept editing the wrong one. One file, included everywhere. That alone would have saved me two nights.
Then make it yours
Once the four screens work, add one small feature that makes it yours. A search box. A count of total contacts. A CSV export. One feature, finished, teaches more than five features half done.
Then write a README on GitHub. What it does, how to run it, a screenshot, and one thing you would improve. That README is what a recruiter reads before they look at your code. Most beginners skip it.
If you want the foundations explained properly, including how the browser, server, and database talk to each other, the Software development for absolute beginners course covers it before you touch a framework.
What to do this week
Install XAMPP, create one table, and get a list page showing data from it. Not a form, not a login, just the list. If the page loads and shows an empty table, you have done the hardest part. Everything after that is repetition with different words.
Next, read what is an API and why every developer needs it and why your code works on your laptop but not on the server.