RUVIDEO
Поделитесь видео 🙏

Creating MySQL database with PHP

📁 Обучение 👁️ 16 📅 08.12.2023

Welcome to PHP programming,

MySQL is the most popular open-source database system.

The data in MySQL is stored in database objects called tables.

A table is a collections of related data entries and it consists of colums and rows.

A query is a question or a request

With MySQL, we can query a database for specific information and have a record set returned.

The query would look like this

SELECT * FROM persons;

STEPS TO CREATE MySQL DATABASE

Start the web server using the xampp control panel and chose MySQL to start

There are two ways to create a database:

a) Open the url http://localhost/dashboard

b) Click on phpMyAdmin

c) Chose databases and give the name to the database you wish to give.

d) Click on create button

Now your database is created and you can add tables to your database

Write the name of the table and chose how many columns you would like to have and click on go button.

After the table is created, add columns to the table as requird and keep in mind that each tables should
have a primary key field.

Primary Key:

1) It is used to uniquily identify the rows in a table
2) Each primary key value must be unique within the table
3) The primary key field cannot be null because the database engine requires a value to locate the
record
4) The primary key is often an ID number, and is often used with the AUTO_INCREMENT setting
5) AUTO_INCREMENT automatically increases the value of the field by 1 each time a new record is
added.
6) To ensure that the primary key field cannot be null, we must add the NOT NULL setting to the
field.

This is how table is created and columns are added.

Second way of creating database is using queries.

To create a database, the CREATE DATABASE statement is used in MySQL.

Syntax:
CREATE DATABASE database_name;

Let us write a PHP code to create a database

Save it in our server i.e., xampp/htdocs

Run the code using the url http://localhost/dbd.php

This how the database is created using PHP script.

To create a table, CREATE TABLE statement is used in MySQL

Syntax:

CREATE TABLE tablename
(
column_name1 data_type,
column_name2 data_type,
.....
)

Let us write a PHP code to create table to our database 'company'

Save it in our server i.e., xampp/htdocs

run the code using the url http://localhost/dbdtable.php

A database must be selected before a table can be created, the database is selected with the
mysqli_select_db() function

When you create a database field with data type, you must specify the maximum length of the field.

The datatype specified what tpe of the column can hold

This is how tables are created using queries in PhP script.

Thank you..............

For source code kindly refer www.studentprojects.live

Do you have Any queries? Contact us in Whatsapp :- +91-9972853368

#studentprojects #phpcode

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Creating MySQL database with PHP», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.