How to Connect PHP to MySQL Database using XAMPP

preview_player
Показать описание
Learn How to Connect PHP to mysql database using xampp ..

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

Update: If you get an error that says 'call to undefined function mysql_connect()', it means that this function was already removed in newer versions. Use mysql_connect() or PDO functions instead. See official documentation on php dot net.

Also, if you're a mac user, you might have problems accessing htdocs repository. In XAMPP application go to 'Volumes' tab and press 'Mount'. A new directory will open under Locations in you Finder. Press there, go to lampp folder and you will find htdocs there. Good luck!

dinmukhammadbekzhan
Автор

Good job bro! Really clear instructions, best video out there for connecting to database using xampp!

knsense
Автор

Tutorial is good. Thanks for making.
But i would request you to increase video quality as we are having little bit problem to see some PHP scripts.
and it seems you have not shared annoted doc as you mentioned in the video.

MAYURROKDE
Автор

Excellent tutorials, question Can I do this with my website, accessing a remote local ms-sql-server database?

jlclavijocanada
Автор

Looked everywhere for a simple solution, this worked the first try. Thank you so much!!!
Quick question, if i wanted to create a mySQL table and insert data using a php page I made instead of making one through phpMyAdmin and adding data would that work?

daniel_gallardo
Автор

thanks bro it helps a lot and anyone who is facing regarding the error "Call to undefined function mysql_connect()" try using this
<?php
$dbhost = 'localhost';
$user ='root';
$pass ='';
$db ='testdb'; // databasename
$conn=mysqli_connect("$dbhost", "$user", "$pass", "$db");
echo "Connected";

?>

Azlanabbas
Автор

excellent tutorials....moreover in hindi its much understandable..ty for have one query ...I am making a web page for students to see solution of questions. I have takes all questions and answers in png form seperately. Now i want them to fill a scrollable form with option to get there desired question and answer. For ex, they will choose fst class, then subject, then chapter, then exercise, and then question. then after clicking submit button both pics must be displayed in a panel. Please tell me how to do this.

krishnakantsinghBundela
Автор

Thank you, but could you update the PHP script to the new format using mysqli_, instead of mysql ?

gk
Автор

Fatal error: Call to undefined function mysql_connect() in on line 7 i need help for this !

Itssilver
Автор

Why do you need quotes around $username when you use it as a parameter for mysql_connect, but not when you use $db as a parameter for mysql_select_db?

andrewjbidlen
Автор

Hello bruther, i am a new member of your centeen . I want to learn how to create a MySQL Database using XAMPP.

md.arafathossain
Автор

thank you, simple and useful and helpful!

sophietsai
Автор

Rishta kya kehlata hai soundtrack in the background proves that in all Indian households, the remote belongs to the women, hence men are confined to connect MySQL and PHP :P

aditiaparna
Автор

hi can you pls explain where you put mysql file and where you put php file?

mao-weinilsson
Автор

Thanks, however it didn't connect until I changed mysql to mysqli . The "i" is important.

vincentwalsh
Автор

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in Stack trace: #0 {main} thrown in on line 6




help me why its error is arise

Privikachauhan
Автор

I am using ubuntu 16.04.
My XAMPP folder is located in opt directory, in which directory do I need to save the php file .

relaxing_beats
Автор

If I want to use a seperate sql database how would I do that?

ItsPheenix
Автор

Why didn't you put a double quote on $db? and why does it still works?

jnaz
Автор

i have downloaded xamp and localhost home page is not opening . i dont know what to do next?? i already have a prototype designed on which i will work. please guide soon

ghulamzainab
join shbcf.ru