From the course: PHP: Object-Oriented Programming with Databases

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create a database table

Create a database table - PHP Tutorial

From the course: PHP: Object-Oriented Programming with Databases

Start my 1-month free trial

Create a database table

- [Instructor] Now that we have a database and we have a user that has the ability to access that database from our application, we're ready to create a database table that's going to store the data about the different bicycles that the chain gang bicycle shop is going to be selling. To do that, we'll need to create a new table, using the SQl syntax. So this is what the table structure is going to look like. We're going to have a number of different attributes, beginning with ID. Every record is going to have an auto incrementing ID, that's going to be its primary key. And then we're going to have columns that correspond to the data that we saw in the table for each bicycle. So we'll have brand, model, year, category, gender, color, price, weight_kg for kilograms, condition_ID, and description. Now I know this is a lot of typing. So rather than having to type all of this in, I've provided you with a couple of snippets in the exercise files that you can use to save yourself some time…

Contents