PHP MySQL Tutorial: Connect to a MySQL Database -HD-

preview_player
Показать описание
In this tutorial, you will learn how to connect to a MySQL database using PHP.

Be sure to SUBSCRIBE because there will be a new tutorial every week.

Follow me on Twitter @RiverCityGraphx

Рекомендации по теме
Комментарии
Автор

The torture you talk about is useful for those of us that do not use DW or are just starting to code websites. I also think that it is a bit suspicious that a company that sells training is here flaming a free tutorial.

Himshaw
Автор

thanks !! Good tutorial, it s very abstract until getting all working!

nomadafe
Автор

for anyone watching now here's the right code (also note it's mysqli with an "i"):


<?php
$Hostname = "localhost";
$User = "yourusername";
$Password = "yourpassword";
$dbName = "yourDbName";

$Link = mysqli_connect($Hostname, $User, $Password, $dbName) or die ("Could not connect to Server.");
mysqli_select_db($Link, "$dbName") or die ("No Database Found.");

echo "Connected Successfully.";
?>

mysql_connect & mysql_select_db are both deprecated. all you have to do is add an i after the L. and with select_db, it takes 2 params, so all i did was give the mysqli_connect a name and drop it in mysqli_select_db with the db string.

hope this helps.

LaughingBatGames
Автор

Ohh...
P.S.: Really good work, thanx for your videos! (liked and subscribed... :D )

Svorpsts
Автор

In order to make extend my db-connect script to take a username and password from form input and modify those values in the included file to I have to declare the form data variables as globals?

nicholasfazzolari
Автор

is there other tutorial just similiar with this, but connect to MySQL remote server using SSL..

yanuaradi
Автор

i got this error:-
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in Stack trace: #0 {main} thrown in on line 7
can anyone help me plz?

anismughal
Автор

it says "Parse error: syntax error, unexpected T_ECHO in C:\connect.php on line 10" what can i do to fix it can anybody help me??

mind-wired
Автор

What if you are using phpmyadmin? Would it be the same process?

hannahajayi
Автор

I wish you have numberings on your videos. Good tutorial though, .

katsuneshinsengumi
Автор

Im looking for a tutorial that will tell me how to call down information from a specific row. 

willflip
join shbcf.ru