Тёмный

PDO Connections to MySQL from PHP 

Steve Griffith - Prof3ssorSt3v3
Подписаться 101 тыс.
Просмотров 11 тыс.
50% 1

When you are using a MySQL database with your PHP, you need to create a connection between the PHP and the MySQL programs.
A PDO connection is the best way to do this.
This tutorial covers how to create a database and user through PHPMyAdmin and then to connect to the database from a PHP page.
webpage Code GIST: gist.github.com/prof3ssorSt3v...
connection page Code GIST:

Опубликовано:

 

2 июн 2018

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 15   
@prashanthkumar0
@prashanthkumar0 5 лет назад
your channel is awesome ...
@KentaroxKondo
@KentaroxKondo 9 месяцев назад
Thank you so much!
@webstuff56
@webstuff56 6 лет назад
I didn't know you did PHP as well--I've been refocusing here, good news
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 6 лет назад
There is a long list of topics that I have worked with. It's always a matter of having enough time to try and put all that information together into videos.
@webstuff56
@webstuff56 6 лет назад
I'm glad to see it, Steve. Thank you. I always knew server side was my passion. But I think like most everyone gets trapped thinking they must master JS. Then JS becomes this full-time program that seems you can never get enough of. I think the key to JS is in understanding where it's ok to stop. For your basic web developer, I think the basics along with the DOM and AJAX one should figure out this is where to walk away from. Otherwise you get trapped in an endless cycle where you become obsessed with trying to become something you dont need to be at the expense of everything else. I am so loving PHP and mysql: the two amigos ;) so much can be done with them.
@prashanthkumar0
@prashanthkumar0 5 лет назад
great
@westfield90
@westfield90 5 лет назад
Thank you. I really appreciate your clear concise explanations and the variety of topics. Just one question. Do you need a minimal version of PHP in order to use PDO?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 лет назад
Version 5.1 of PHP is where PDO was added. You would be hard pressed to find a server that isn't running at least that version, if not version 7. Here is the reference for PDO - php.net/manual/en/class.pdo.php
@webstuff56
@webstuff56 6 лет назад
when would one use mysqli or any other connection method? and why would one be preferred over the other?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 6 лет назад
The mysql methods came first but were insecure. Then mysqli which was mysql improved. The PDO was added. PDO is a much better implementation which includes support for transactions. It is the best choice. No need for anything else.
@webstuff56
@webstuff56 5 лет назад
what would the DNS be if the file here was on a external webserver: $db = new PDO('mysql: host=what????; is it the domain name of the website associated with this?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 лет назад
It can be the domain name or an ip address. As long as the external server allows connections from external sources. When you create permissions for the users on the MySQL RDBMS you need to indicate whether it can be accessed from localhost or from external.
@webstuff56
@webstuff56 5 лет назад
Yes thank you; I'm referring to a hosted website
@banglaanimereviewssl4729
@banglaanimereviewssl4729 8 месяцев назад
sir i need some help because i have tried many time but it said "couldn't find the server"
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 8 месяцев назад
Is your webserver running? Is your MySQL server running? correct ip address? correct port number?
Далее
Спецэффекты в Симс 4
00:36
Просмотров 167 тыс.
Фонтанчик с черным…
01:00
Просмотров 1,9 млн
меня не было 9 дней
12:48
Просмотров 2 млн
Session Management Intro with PHP
19:32
Просмотров 11 тыс.
PHP how to connect to MySQL database
8:50
Просмотров 8 тыс.
How to connect to MySQL database using PDO
12:38
Просмотров 10 тыс.
PHP $_FILES and Handling File Uploads
19:36
Просмотров 6 тыс.
What does MySQLi vs PDO Teach You about Development?
13:19
How to Connect to a Database by Using PHP PDO
10:18
Просмотров 14 тыс.
Filtering and Sorting with PDO and MySQL
21:41
Просмотров 4,8 тыс.
Intro to PHP
12:51
Просмотров 7 тыс.
Спецэффекты в Симс 4
00:36
Просмотров 167 тыс.