view data PHP

Doctor of Melodic
6 Apr 202221:40

Summary

TLDRThis video tutorial offers a step-by-step guide on creating a database schema using PHP's native capabilities. The host begins by setting up a database and navigating to the PHPMyAdmin interface. They demonstrate how to create a new table, define columns, and set properties like auto-increment. The script then shifts to developing a PHP application, including HTML file setup and PHP syntax for database connection and querying. The tutorial concludes with inserting sample data and displaying it on a webpage, ensuring the process is accessible to beginners.

Takeaways

  • πŸ˜€ The video is a tutorial on creating a database style using PHP native.
  • πŸ”§ The presenter suggests preparing the database first and provides guidance on how to access it.
  • πŸ“ It's mentioned that there's a tutorial on installing PHP on the channel for those who need it.
  • πŸ’» The video covers the process of navigating to localhost and setting up an admin panel for database management.
  • πŸ› οΈ The script explains how to create a new database and name it, using 'Create database' option.
  • πŸ“‹ The presenter describes creating a table within the database by specifying column names and types.
  • πŸ”‘ It's highlighted that one of the columns should be set as 'autoincrement' for automatic data entry.
  • πŸ” The video includes a step-by-step guide on inserting data into the newly created table.
  • πŸ“ The presenter discusses setting up the application side, including creating necessary HTML and PHP files.
  • πŸ–ŒοΈ The tutorial touches on the basics of HTML structure, including the use of 'table' to organize data.
  • πŸ”„ The script explains the use of PHP syntax for connecting to the database and executing SQL queries to fetch data.

Q & A

  • What is the main topic of the video?

    -The main topic of the video is creating a data style from a database using PHP native.

  • What is the first step mentioned in the video for setting up the database?

    -The first step is to prepare the database, which might involve installing PHP if it's not already installed.

  • What is the address to access the database setup in the video?

    -The address to access the database setup is 'localhost/phpmyadmin'.

  • How does the video suggest creating a new database in phpMyAdmin?

    -The video suggests clicking on 'New' and then typing in 'Create database' to create a new database.

  • What is the name of the database created in the video?

    -The name of the database created is 'ellen'.

  • What are the steps to create a new table in the database as shown in the video?

    -The steps include clicking on the database name, then clicking on 'New', entering the table name, and defining columns with their respective names and data types.

  • What is the purpose of setting 'autoincrement' for the 'kode' column in the table?

    -Setting 'autoincrement' for the 'kode' column allows the system to automatically increment the value for each new entry, ensuring unique identifiers for each record.

  • How does the video demonstrate inserting data into the database?

    -The video demonstrates inserting data by manually entering values for each column in the table through the phpMyAdmin interface.

  • What is the suggested file structure for the PHP application as per the video?

    -The suggested file structure includes creating a folder named 'flash' and files such as 'index.php', 'controller.php', and 'model.php' within a 'www' directory.

  • How does the video guide the process of connecting to the database using PHP?

    -The video guides the process by creating a 'config.php' file that contains the database connection details and using PHP's 'mysqli_connect' function to establish a connection.

  • What is the purpose of the SQL query shown in the video?

    -The SQL query is used to select all records from the 'perusahaan' table and is intended to display the data on the web page.

  • How does the video handle displaying data from the database on a web page?

    -The video demonstrates using a loop in PHP to fetch data from the database and then display it within an HTML table structure on the web page.

Outlines

00:00

πŸ˜€ Introduction to PHP Database Styling

The video begins with an introduction to creating a database style using PHP's native capabilities. The presenter suggests preparing the database first, mentioning a tutorial on installing PHP on a local server. The audience is guided through accessing the database via a browser using 'localhost' and logging in with provided credentials. The presenter then instructs on creating a new database and setting up its structure, including naming columns and specifying data types, with an emphasis on auto-incrementing IDs for company codes.

05:04

πŸ“ Database Table Creation and Data Insertion

This paragraph covers the process of creating a table within a database and inserting data into it. The presenter explains how to define the structure of a 'perusahaan' (company) table, including columns for company code, name, address, phone, and email. The audience is shown how to input data for a company, including setting up an auto-incrementing primary key. The presenter also discusses potential issues that may arise during data insertion and how to address them.

10:09

πŸ› οΈ Setting Up the PHP Application Environment

The script moves on to setting up the PHP application environment. The presenter outlines the need for HTML files and suggests creating a directory structure for the project. They guide the audience through creating PHP files for the application, emphasizing the importance of using the correct file extensions. The video also touches on the basics of HTML structure, including the use of 'html' and 'body' tags.

15:11

πŸ” PHP Syntax for Database Interaction

In this part, the presenter delves into the PHP syntax required to interact with a database. They explain the need for a 'config.php' file to handle database connections and a 'query' to fetch data. The audience is shown how to write the PHP code for connecting to the database and executing a SELECT query to retrieve data from the 'perusahaan' table. The presenter also discusses common errors and how to troubleshoot them.

20:15

πŸ”„ PHP Loop for Displaying Database Records

The final paragraph focuses on using PHP loops to display records from the database. The presenter demonstrates how to modify the HTML structure to incorporate PHP code that iterates over the database results and displays them on a webpage. They provide a step-by-step guide on inserting PHP code within the HTML body to achieve this, ensuring the data from the database is presented in a readable format on the web page.

πŸ‘‹ Conclusion and Final Thoughts

The video concludes with a brief summary of the process of creating a PHP-driven web page that displays data from a database. The presenter encourages viewers to pay attention to any errors that may occur and to ensure that the code is correctly implemented. They remind the audience to save their work and to check the browser for the final output, ending the tutorial on a positive note.

Mindmap

Keywords

πŸ’‘PHP

PHP, which stands for Hypertext Preprocessor, is a widely-used open-source server-side scripting language primarily for web development. In the video's context, PHP is used to interact with a database and create dynamic web pages. For instance, the script mentions 'PHP native' to refer to using PHP without any additional frameworks or libraries.

πŸ’‘Database

A database is an organized collection of data, typically stored and accessed electronically. In the video, the creation and manipulation of a database are central to the tutorial, with the script detailing how to set up and interact with a database using PHP for web development purposes.

πŸ’‘localhost

Localhost is a hostname that refers to the local server on which the web browser is running. In the script, 'localhost' is used to access the PHPMyAdmin interface for database management and to test the PHP scripts locally on the user's own computer.

πŸ’‘PHPMyAdmin

PHPMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL over the web. The script refers to PHPMyAdmin as the interface through which the user can create and manage databases and tables, such as creating a 'perusahaan' (company) table.

πŸ’‘Table

In the context of databases, a table is a collection of related data held in a structured format within a database. The video script describes the process of creating a table named 'perusahaan' with various columns to store company-related data.

πŸ’‘Column

A column in a database table is a vertical group of cells that contain data of the same data type. The script mentions creating columns such as 'kode_perusahaan' (company code) and 'nama_perusahaan' (company name) within the 'perusahaan' table.

πŸ’‘Autoincrement

Autoincrement is a property of a column in a database table that automatically increments the value of the column with each new record added. In the script, it is mentioned as a feature for the 'kode' column to automatically assign a unique ID to each company entry.

πŸ’‘VARCHAR

VARCHAR is a data type in SQL used for storing variable-length character strings. The script specifies VARCHAR for columns like 'alamat' (address) and 'email' to allow for text input of varying lengths.

πŸ’‘HTML

HTML, or HyperText Markup Language, is the standard markup language for creating web pages and web applications. The video script includes creating an HTML file with basic structure to display data from the database on a webpage.

πŸ’‘PHP Syntax

PHP Syntax refers to the set of rules governing the structure of PHP code. The script discusses the need for proper PHP syntax when writing code to connect to a database and query it, such as using 'include' to include a configuration file and 'mysqli_query' to execute SQL queries.

πŸ’‘Configuration File

A configuration file is a file used to store configuration data, settings, or parameters for a software application. In the script, a 'config.php' file is created to store database connection details like database name, username, and password.

Highlights

Introduction to creating a database style using PHP native.

Preparation of the database before starting the tutorial.

Instructions on how to access the PHPMyAdmin interface.

Explanation of how to create a new database in PHPMyAdmin.

Guidance on naming the database and setting up initial tables.

Creating a table named 'perusahaan' with specific columns.

Setting up auto-increment for the 'kode' column in the table.

Adding columns for company name, address, phone, and email.

Instructions on how to save the table structure in the database.

Demonstration of inserting data into the 'perusahaan' table.

Explanation of potential errors and how to troubleshoot them.

Setting up the application environment with necessary files.

Creating HTML files for the application interface.

Introduction to PHP syntax for database connection and queries.

Creating a 'config.php' file for database connection settings.

Using SQL queries to fetch data from the 'perusahaan' table.

Implementing PHP loops to display data on the HTML page.

Finalizing the application setup and testing in the browser.

Troubleshooting steps if the application does not work as expected.

Conclusion and reminder to follow for more tutorials.

Transcripts

play00:00

Halo selamat jumpa lagi di video kali

play00:05

ini kita akan

play00:06

membuat style data dari basis data

play00:11

secara sederhana ya menggunakan

play00:14

PHP native yuk

play00:18

Ayo kita langsung saja

play00:22

sebelumnya bisa disiapkan dulu

play00:24

databasenya

play00:27

Hai dan dari Insan HP besok kalau yang

play00:30

nggak tahu jalan misalnya

play00:32

ada di channel ini cara menginstal HP

play00:34

besok

play00:36

kalau sudah bisa langsung

play00:40

Arahkan

play00:43

browsernya ke alamat localhost garis

play00:47

miring PHP maybe

play00:53

Hai penulisannya gimana tinggal di ikuti

play00:57

saja ya

play01:00

localhost.php May admin seperti ini ya

play01:07

di localhost smake kalau pakai it's

play01:11

pakai http titik 2

play01:14

Hai garis miring double localhost

play01:16

flash.php

play01:18

May admin

play01:22

Oh ya

play01:23

Hai Neng kalau sudah

play01:27

URL

play01:30

hai magazine nah serangkai

play01:34

user-user nyalon passwordnya Ellen May

play01:40

e-learning

play01:43

Halo Muti and the

play01:46

pengen kalau yang belum ada basis

play01:49

datanya silakan buat diklik new

play01:54

Hai teknik new

play01:56

ngetik aja

play01:59

Create database

play02:00

one create a Laila Anda bisa karena saya

play02:06

sudah ada databasenya Allen

play02:09

paint kalau belum lah buat buat dulu di

play02:12

sini ya grade Kalau sudah seperti ini

play02:15

kemudian kita membuat lapisan

play02:20

ndak habisnya kita membuat databasenya

play02:24

caranya gimana

play02:26

caranya sederhana sekali Nah kita

play02:31

tinggal di sini ada di bawah pohon

play02:35

tetapi serem adanya Wow klik aja

play02:40

klik aja kemudian

play02:44

Hai Masukkan nama kolomnya

play02:49

nama kolomnya

play02:52

Hai karena kalau nyata Edi

play02:57

hai hai

play02:59

Hai name

play03:01

the lounge

play03:06

paint hai oh sorry sorry

play03:10

hai Sebelumnya kita buat nama tabelnya

play03:13

dulu nah kabelnya belum ya nama kadonya

play03:18

kita mau menampilkan data perusahaan nah

play03:21

di tabel named ditulis aja

play03:28

erpan1140

play03:33

Hai kemudian

play03:36

di kolom pertama

play03:41

kode-kode perusahaan

play03:44

di kolom kedua

play03:48

Hai nama perusahaan secara singkat temen

play03:51

saya prsh

play03:54

Halo Mutia nada

play03:57

Hai alamat

play04:00

hwaaa jahat telepon

play04:06

Hai masih kurang satu tambahkan saja nih

play04:09

Klik go di sini ya aku

play04:15

Hai Mbak dan email

play04:21

Hai saya ingin

play04:23

kode ini

play04:26

autoincrement jadi dia akan bisa

play04:28

menambah otomatis

play04:30

masukkan panjangnya berapa karakter

play04:32

integer

play04:33

Hai Yang mutian kalau ada ai centang

play04:37

saja nih

play04:38

Ndak indeks pilih Premier

play04:42

the lounge

play04:44

ndak bilang seperti ini klik gua aja

play04:48

paint

play04:50

Oke kemudian

play04:54

the lounge

play04:55

Hai supaya gampang disampaikan saja yang

play04:58

lainnya tipenya varchar2

play05:04

Indonesia

play05:06

varchar rumah panjang adaptornya sanakan

play05:10

aja biar gampang 100 gitu ya

play05:14

hai hai

play05:19

hai oke sudah

play05:24

Hai kalau sudah

play05:27

klik save

play05:30

the lounge

play05:32

e-cash sampai sini

play05:35

tabel perusahaan berhasil dibuatnya kita

play05:39

akan coba memasukkan datanya di tabel

play05:43

basis data yuk Coba masukkan

play05:49

Hai perusahaan pertama yang mau

play05:51

dimasukkan

play05:53

Hai namanya silakan ketik

play05:56

value kode ini bisa

play06:00

10 karena dia nanti akan

play06:03

auto-increment

play06:05

Nah mudian alamatnya

play06:11

Faisal begini ya kemudian

play06:15

membuat telepon

play06:17

Hai nah asal saja nih

play06:21

Kayla

play06:23

Hai kemudian alamat email

play06:32

Hai nah yang baris pertama saya mau dua

play06:35

baris yang kedua bisa dimasukkan

play06:40

the lounge

play06:41

eh selamat perusahaannya lagi

play06:47

ngomonge alamat

play06:54

Hai nomor telepon

play07:05

halo halo sudah

play07:08

klik2d

play07:11

Hai apa yang terjadi

play07:13

ini keluarnya

play07:16

Dian yang terjadi

play07:18

Indonesia

play07:22

ia meminta data perusahaan berhasil

play07:25

dimasukkan

play07:27

nah berhasil di masukkan Nah sekarang

play07:35

ditetapkannya sudah selesai kita akan

play07:37

membuat di sisi aplikasi

play07:43

Fauzi aplikasi yang harus disiapkan apa

play07:46

yang pertama adalah

play07:50

file-file

play07:53

html5lib html dulu ya

play07:57

silahkan

play07:59

siapkan foldernya nah di

play08:02

direktori

play08:07

www.foldertips.com tetes

play08:12

di kemudian

play08:18

ndak mau

play08:20

Hai buat folder flash transmisja hujan

play08:24

membuat file

play08:27

idex.com php ya kontrol

play08:32

and1 tphp

play08:38

Oh yes

play08:40

nah

play08:42

pastikan ekstensinya menjadi dot PHP ya

play08:46

bukan Cut txt jika sudah

play08:50

pengen buka siapa akhirnya not bad

play08:54

plus-plus nya notepad-plus-plus kita

play08:57

akan mencoba

play09:00

cara membuat es

play09:03

Hai tabel Mea cara membuat tabel

play09:08

Indonesia

play09:10

nya hati kalau

play09:13

Hai komponen html sederhana misinya akan

play09:16

tab html

play09:18

dan body

play09:20

khate bisa ada bisa ndak takutnya nih

play09:24

kurang tutupnya nih

play09:26

the lounge

play09:29

Hai hewan ini nah

play09:32

di sini saja sudah bisa Nah untuk

play09:35

mengisi

play09:38

Hai pakai

play09:40

film porno tabel sekadar mengisi tak

play09:44

body kita mengisi menggunakan

play09:48

qwerty Hai tabel

play09:52

nyari duit Ayah kita mengisi menggunakan

play09:57

tabel

play09:58

ngisinya gimana nah

play10:02

Hai di sederhananya

play10:09

the lounge

play10:11

ngences saya bus dulu pelan-pelan ya

play10:17

Hai nah

play10:19

Hai tadi

play10:21

halaman html dengan out segini aja sudah

play10:25

bisa sambil

play10:28

yo yo kita akan coba memanggilnya cara

play10:32

manggilnya Gimana kalau tadi

play10:36

localhost-phpmyadmin sekarang diganti

play10:40

menjadi localhost

play10:42

tes tes

play10:46

localhost tes

play10:49

Hai kakak bisa berjalan

play10:57

indikator makro kasus tes

play11:00

Hai nah

play11:02

Kailani awal seperti ini ya

play11:05

halo halo

play11:07

Hai biasa Nah karena kita ingin

play11:11

mengambil data dari

play11:16

Hai database kita memerlukan sintaks PHP

play11:21

syntax PHP nya seperti apa nah

play11:26

times in the HPnya seperti apa

play11:31

yo yo kita buka lagi notnya

play11:36

Oh ya syntax PHP ya lu

play11:41

Ayo kita taruh di paling atas

play11:44

nya

play11:47

Ayo kita butuh dua syntax yang pertama

play11:49

inputwts config.py HP ini untuk

play11:52

memasukkan file konfigurasi ke basis

play11:56

data mengemudi and the

play11:59

my god yang kedua dinamakan query ya

play12:03

untuk memilih

play12:05

Hai menampilkan apa dari database ke

play12:09

Hai Yuk kita ubah dulu dari yang pertama

play12:14

config.py hp berarti di sini kita

play12:17

memerlukan satu file lagi yang namanya

play12:21

[Musik]

play12:23

config.py HP

play12:26

nya by lagi ke

play12:30

folder

play12:32

Ayo kita bikin

play12:35

the lounge config.py HP ya

play12:41

Hai juga lagi pakai nobatin

play12:45

the lounge

play12:49

the

play12:50

lounge yah bukan lagi pakai notepad

play12:52

kemudian

play12:55

Hai ketikkan kode berikut

play13:02

Hai nah

play13:04

Hai Bisa sedih samakan saja

play13:09

Indonesia

play13:12

Titi sini

play13:15

Hai ada variabel yang namanya database

play13:17

Husni mvcm password nah tetap is named

play13:22

tadi ya nama databasenya Ellen username

play13:25

lem password on saya

play13:30

kemudian

play13:32

ketikkan ini ya met sekali connect

play13:37

memanggil function untuk connect ke

play13:39

basis data

play13:41

di sini kalau berhasil melihat di sini

play13:44

kalau berhasil

play13:46

Indonesia di sini kalau berhasil saya of

play13:50

Gan dulu

play13:51

Indonesia

play13:53

Hai tampilannya di browser akan seperti

play13:55

apa

play13:58

Hai tampilannya di browser tidak ada

play14:01

apa-apa

play14:03

hai tapi kalau misalkan

play14:07

Hai saya ganti

play14:09

Hai ada konfigurasinya yang salah jatam

play14:13

bahkan X disini Seninnya simpan kembali

play14:17

lagi ke browser

play14:19

Hai reload Nah ke-3 ada error nih akses

play14:23

deenay

play14:24

jadi jangan kaget kalau nanti ada error

play14:27

cek lagi konfigurasi data Inggrisnya

play14:32

the lounge

play14:36

Gmail login kemudian kembali lagi ke

play14:41

index.co HP disini Resort Adam SQL Query

play14:45

in Nah di sini

play14:46

ada kode lagi Slack Bintang from nah ini

play14:51

memilih semua dari nama tabel nah di

play14:57

nama tabelnya apa

play14:58

Hai nama tabelnya adalah baru saha antre

play15:05

nama tabelnya adalah perusahaan

play15:10

Hai jadi ini diganti saja

play15:13

nah Soleh Bintang from perusahaan order

play15:17

by nah

play15:19

Ok Sekarang kita ganti header tabelnya

play15:25

kita ganti Hijr

play15:28

stabilnya sesuai dengan nama di database

play15:33

Nah tadi kan adanya

play15:38

Hai sepeda tapi yang mana pak ini dengan

play15:41

ada nama perusahaan Nah klik dua kali

play15:44

kopi aja nih kontrol C

play15:47

kembali lagi the text editor

play15:52

Hai nama perusahaan dari dosanya dihapus

play15:55

aja ya Hai atau perusahaan ajalah ya

play16:02

bye berusaha

play16:06

bahan2 Maaf ujian ada apalagi

play16:14

Hai Selain itu ngaca alamat Nah nanti

play16:19

dimasukkan saja di text editor

play16:24

Oh ya dimasukkan lagi dites editor nah

play16:28

supaya ndak salah ngetik copy-paste aja

play16:31

ya ke pipa saja alamat

play16:38

Hai Oh ya tadi mencetnya struktur ya

play16:40

alamat

play16:41

kemudian

play16:43

Imel pernah

play16:46

yo yo sama hujan

play16:50

KMU jadi isi teks editor jadinya seperti

play16:53

ini

play16:55

Hai film cek Apakah sudah berhasil jika

play17:01

Hai diri Los aja tadi

play17:04

udah berhasilnya sekarang Kidnap buat

play17:09

isiannya

play17:10

kita buat isiannya isiannya pakainya apa

play17:14

pakai kita manfaatkan perulangan

play17:18

menggunakan

play17:20

PHP nah Hai perulangan di php nah

play17:25

diletakkannya di mana Wak

play17:27

Ndah

play17:29

Letakkan yang kita buka lagi Text Editor

play17:31

nya

play17:32

the lounge

play17:34

Hai diletakkannya di bawah penutup PR

play17:39

nih label ruh yuk ke bebas Raj

play17:43

kepentingan ini

play17:45

Hai nah

play17:48

Hai diperhatikan ini ada terbuka berarti

play17:52

kurang TR tutup mah

play18:00

CR untuknya ada dimana

play18:09

Hai televisi rejobanget

play18:14

Indonesia

play18:17

Hai nah

play18:19

the lounge

play18:22

lebih

play18:24

Hai

play18:25

kemudian

play18:26

diusir datanya Ini diganti nama sesuai

play18:30

kolom di tabel

play18:33

Oh maksudnya gimana Pak samain aja

play18:35

latihan

play18:38

ini berarti perusahaan

play18:41

Hai mangsa makan aja nih nama kopi aja

play18:44

kontrol C

play18:46

kemudian di

play18:50

di copy paste

play18:54

Hai nama perusahaan mudian habis tu

play18:57

alamat-alamat kipas aja Alamatmu Dian

play19:01

email ke Ndra ge sampai sini udah

play19:07

selesai Berarti jangan lupa disimpan

play19:11

pengen ujian Kita by lagi ke browser

play19:16

hai cek Apakah sudah berhasil jika

play19:21

hai tuh

play19:22

Hai wajah error di Line

play19:34

hai tuh ini salah nih

play19:39

aaah

play19:41

Hai tanda keris bentuknya dihapus flute

play19:48

Hai Oh masih salah

play19:57

Hai nah Hai ordernya coba hati aku

play20:01

sajalah Nila tadi bukan aidya tadi

play20:08

Hai Nah setelah selesai

play20:10

bikin Iya gampang sekali cara

play20:15

Hai pembuatan

play20:17

tabel biodata

play20:21

Hai nah

play20:24

Halo pak Bingung caranya

play20:27

mulus kodenya bisa pelan-pelan

play20:31

Hai di paus ya untuk

play20:34

kodenya nah di sana aja nih dari

play20:40

Hai buka tak PHP memasukkan

play20:46

Hai kemudian

play20:48

melakukan query ini Komentar beli

play20:52

ditulis boleh ndak

play20:55

Oh ya mutian bikin html head title

play21:02

kemudian bikin di dalam body-nya

play21:08

Hai bisa dipakai saja disamakan

play21:10

penulisannya ndak ada yang saya

play21:13

tutup-tutupi samakan

play21:16

Hai kalau ada error perhatikan lagi

play21:18

dicek ya pasti

play21:22

ia tidak akan ada yang

play21:24

tidak bisa hal pasti bisa nah

play21:29

Hai deh sekian ya video kali ini nah

play21:34

jangan lupa saya happy

play21:38

hai

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
PHP TutorialDatabase DesignWeb DevelopmentMySQLCoding GuideScript AnalysisTable CreationData ManagementWeb HostingPHP Syntax