Это видео недоступно.
Сожалеем об этом.

How to Connect PHP to MySQL Database using XAMPP

Поделиться
HTML-код
  • Опубликовано: 5 авг 2015
  • Learn How to Connect PHP to mysql database using xampp ..
    Full Playlist: • How to Connect PHP to ...

Комментарии • 163

  • @dinmukhammadbekzhan9584
    @dinmukhammadbekzhan9584 4 года назад +2

    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!

  • @Azlanabbas
    @Azlanabbas 7 лет назад +5

    thanks bro it helps a lot and anyone who is facing regarding the error "Call to undefined function mysql_connect()" try using this

    • @andrey.deocampo
      @andrey.deocampo 6 лет назад

      Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in C:\xampp\htdocs\manex.php on line 8
      Connected
      Why it's like this bro? Thank you in advance

  • @MAYURROKDE
    @MAYURROKDE 7 лет назад +3

    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.

    • @SolutionConeOfficial
      @SolutionConeOfficial  7 лет назад

      Sure.. Will upload entire new video series for Core Php. Bootstrap, and many more

  • @jlclavijocanada
    @jlclavijocanada 2 года назад

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

  • @knsense
    @knsense 8 лет назад +1

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

  • @daniel_gallardo808
    @daniel_gallardo808 7 лет назад +1

    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?

  • @Itssilver1
    @Itssilver1 8 лет назад +4

    Fatal error: Call to undefined function mysql_connect() in C:\xampp\htdocs\test3\conn.php on line 7 i need help for this !

    • @SolutionConeOfficial
      @SolutionConeOfficial  8 лет назад +1

      +Argjend Bytyqi
      Start using mysqli functions for MySql uses

    • @prajwalshetty9968
      @prajwalshetty9968 4 года назад

      After using mysqli I get error like
      "The server requested authentication method unknown to the client [caching_sha2_password]. Please help me with this @solutioncone

    • @eraback2024
      @eraback2024 4 года назад

      @@prajwalshetty9968 same error bro u get solutions of this error

  • @1gk
    @1gk 3 года назад +2

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

  • @krishnakantsinghBundela
    @krishnakantsinghBundela 7 лет назад

    excellent tutorials....moreover in hindi its much understandable..ty for this.....I 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.

  • @jeffersondelossantos6222
    @jeffersondelossantos6222 4 года назад +2

    Thank you, From Philippines

  • @aditiaparna8528
    @aditiaparna8528 4 года назад +1

    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

  • @andrewjbidlen1325
    @andrewjbidlen1325 7 лет назад +1

    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?

    • @SolutionConeOfficial
      @SolutionConeOfficial  7 лет назад

      See in PHP
      Output :
      $a 1 1
      Means if you include double quotes then its same as not including a quote. You can use any one of the conventions..

  • @ZAHIDHUSSAIN-xw8mk
    @ZAHIDHUSSAIN-xw8mk 6 лет назад +2

    Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\d.php:3 Stack trace: #0 {main} thrown in C:\xampp\htdocs\d.php on line 3

  • @vincentwalsh1123
    @vincentwalsh1123 Год назад +1

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

  • @mockingbird3809
    @mockingbird3809 7 лет назад +1

    Good job buddy I support you

  • @sophietsai3284
    @sophietsai3284 8 лет назад +1

    thank you, simple and useful and helpful!

  • @chanakakasun9468
    @chanakakasun9468 7 лет назад +1

    Good one for a beginner

  • @QuickMediaSolutionDelhi
    @QuickMediaSolutionDelhi 8 лет назад +1

    Parse error: syntax error, unexpected '$pass' (T_VARIABLE) in C:\xampp\htdocs\galactica\connect.php on line 5
    why shows this error

    • @SolutionConeOfficial
      @SolutionConeOfficial  8 лет назад

      +Quick Media Solution
      can you show entire code of the connect.php file, so that we can help you

  • @shwetachavan751
    @shwetachavan751 6 лет назад

    I selected xampp control from my local disk and clicked on php and apache after doing that when i try to browse localhost it's not showing localhost/xampp

  • @mao-weinilsson2718
    @mao-weinilsson2718 7 лет назад +1

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

  • @MR.JUNE99
    @MR.JUNE99 4 года назад +2

    OH Thank you Soo much💖🤭🤭🥳🤭🙋✌️✋

  • @Privikachauhan
    @Privikachauhan 7 лет назад +5

    Fatal error: Uncaught Error: Call to undefined function mysql_connect() in E:\xamp\htdocs\php\practise.php:6 Stack trace: #0 {main} thrown in E:\xamp\htdocs\php\practise.php on line 6
    plzzzzzzzzzz help me why its error is arise

    • @SolutionConeOfficial
      @SolutionConeOfficial  7 лет назад +1

      Can you show me the script ?
      Or try
      $conn = mysqli_connect("localhost","root","","database_name") or die("Error in Connection");

    • @SolutionConeOfficial
      @SolutionConeOfficial  7 лет назад +1

      +Preeti Thakur ? Is your problem resolved ?

    • @sumukhahs437
      @sumukhahs437 7 лет назад +2

      use mysqli_connect(...);

    • @mockingbird3809
      @mockingbird3809 7 лет назад

      preeti without using mysql_connection use mysqli_connection()

    • @jodyk2193
      @jodyk2193 7 лет назад

      Hi, I seem to have the same problem. The sqli works for me when connecting, but not the sql. Why is that? Is there something else I can do to get the sql_connect to work instead?

  • @md.arafathossain6815
    @md.arafathossain6815 7 лет назад +1

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

    • @SolutionConeOfficial
      @SolutionConeOfficial  7 лет назад

      +Md. Arafat Hossain okk I will make a series on it.. That will help you

  • @relaxing_beats1
    @relaxing_beats1 6 лет назад +1

    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 .

    • @SolutionConeOfficial
      @SolutionConeOfficial  6 лет назад

      I think in
      mnt -> www

    • @Yash-Gaikwad
      @Yash-Gaikwad 5 лет назад

      /opt/lampp/htdocs
      xampp will look for your files in htdocs dir, put your files in htdocs, and then you can browse localhost/yourfilename.php

  • @LeonSafal
    @LeonSafal 7 лет назад +1

    Thank You !! u are too helpful

  • @sevgiince7452
    @sevgiince7452 8 лет назад

    it is an old version of xammp. But it may be useful. Thanks

  • @Royowski01
    @Royowski01 7 лет назад

    Thank you for this clearful tutorial

  • @jeremytom9288
    @jeremytom9288 7 лет назад +1

    This is the error I am getting:
    Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in C:\xampp\htdocs\connect.php on line 12
    Connected
    What is the other parameter I need?

  • @ghulamzainab7786
    @ghulamzainab7786 7 лет назад

    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

  • @thabogodfreygqeba2782
    @thabogodfreygqeba2782 7 лет назад +1

    Appreciated a lot bruhh

  • @jnaz602
    @jnaz602 7 лет назад +1

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

    • @SolutionConeOfficial
      @SolutionConeOfficial  7 лет назад

      +Pixelite just to slow that.. "$var" Is valid one.. And '$var' is not..
      So you can use.. "$var" or $var but not '$var'

  • @sudhakarreddychintareddy1328
    @sudhakarreddychintareddy1328 7 лет назад +1

    may I known what to do if not showing the add new account in uer account

  • @johnmwansa4180
    @johnmwansa4180 7 лет назад +1

    MR PLEASE IF YOU CAN HAVE TIME. I NEED THIS TUTORIAL ON MAC BECOUSE IAM
    USING THE MAC SO HOW TO BYPASS ON MAC.I KNOW YOU CAN DO IT TRUST YOU SO
    PLEASE IF YOU CAN MANAGE JUST CREATOR ONE VIDEO FOR ME.I LIKE YOUR VIDEO
    VERY MUCH

  • @prajwalshetty9968
    @prajwalshetty9968 4 года назад

    After using mysqli I get error like
    "The server requested authentication method unknown to the client [caching_sha2_password]. Please help me with this

  • @levisman6822
    @levisman6822 6 лет назад +1

    hi i having a problem in first, I typed localhost and i dont see like yours..
    Help me please.. Thank you in advance..

    • @SolutionConeOfficial
      @SolutionConeOfficial  6 лет назад

      Can you tell me which port is configured as your localhost?

    • @levisman6822
      @levisman6822 6 лет назад

      my ports for mySQL is 3306 while the Apache port is 88,443 I don't have any idea of this port so far...

  • @DrawSoEasy
    @DrawSoEasy 8 лет назад

    I really love this video :)

  • @danielbasa1555
    @danielbasa1555 6 лет назад

    Fatal error: Uncaught Error: Function name must be a string in C:\Users\Daniel\Desktop\XAMPP\htdocs\connection.php:2 Stack trace: #0 C:\Users\Daniel\Desktop\XAMPP\htdocs\login.php(2): include() #1 {main} thrown in C:\Users\Daniel\Desktop\XAMPP\htdocs\connection.php on line 2

  • @ItsPheenix
    @ItsPheenix 7 лет назад +1

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

    • @SolutionConeOfficial
      @SolutionConeOfficial  7 лет назад

      mssql_connect($host, $username, $pass, $db)
      Refer :
      php.net/manual/en/function.mssql-connect.php

  • @neeraj_v7070
    @neeraj_v7070 4 года назад +1

    Thank you bro !!

  • @prachim144
    @prachim144 8 лет назад

    Followed the same instructions as shown in video,
    Yet after trying to run on localhost, the connect.php file i got this error:
    Warning: mysql_connect(): Access denied for user 'username'@'localhost' (using password: YES) in C:\xampp\htdocs\core\database\connect.php on line 7
    connected to db
    where if success, i echoed connected to db.
    it is showing both the lines. what does this mean ??
    Also i have localhost and username as root and password as blank.
    My connect.php file is as below:
    Please help for the above

    • @SolutionConeOfficial
      @SolutionConeOfficial  8 лет назад

      May be your password will not be empty, make it root and try again...

  • @whatsup7130
    @whatsup7130 6 лет назад +1

    thanks
    good job man

  • @finding_truthcompany7257
    @finding_truthcompany7257 5 лет назад

    Can we create database without phpMyAdmin.
    I mean is there any other alternative other than phpMyAdmin

  • @dhruvinprajapati5929
    @dhruvinprajapati5929 6 лет назад

    Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\database.php:8 Stack trace: #0 {main} thrown in C:\xampp\htdocs\database.php on line 8

  • @eswarrao4700
    @eswarrao4700 4 года назад

    i am getting an error saying that object not found.. can someone help me out

  • @ashwinisathe7378
    @ashwinisathe7378 4 года назад +1

    still getting error..................Object not fount help me to figure out it

    • @SolutionConeOfficial
      @SolutionConeOfficial  4 года назад +1

      This means there is some issue with linking the page.
      Please rectify

  • @rajendrashendekar5581
    @rajendrashendekar5581 5 лет назад +1

    Thank you!!

  • @lhadycamillesaligo9660
    @lhadycamillesaligo9660 2 года назад

    Fatal error: Uncaught ArgumentCountError: mysqli_select_db() expects exactly 2 arguments, 1 given in C:\xampp\htdocs\php\connect.php:10 Stack trace: #0 C:\xampp\htdocs\php\connect.php(10): mysqli_select_db('solutioncone') #1 {main} thrown in C:\xampp\htdocs\php\connect.php on line 10

  • @renukateli60
    @renukateli60 6 лет назад +1

    nice

  • @asmrtist9058
    @asmrtist9058 4 года назад

    Where can I access dbhost & username and look up the password though? Would be great to know

  • @doc-holiday
    @doc-holiday 8 лет назад +1

    I followed your instruction but i couldn't get this to connect. What i did was change the code to this
    $connected = mysql_connect("localhost", "root");
    and then it worked.

  • @Ravisharma-is6tt
    @Ravisharma-is6tt 7 лет назад +1

    thanks man..

  • @rajkumargadam1259
    @rajkumargadam1259 7 лет назад +1

    Thank you

  • @RashidKhan-ss7em
    @RashidKhan-ss7em 4 года назад

    Admin please tell me how to fix caching_sha2_password in php error

  • @mudasirs7660
    @mudasirs7660 6 лет назад

    Bro it is not visible to learn proper cotes its double cote or single cot

  • @mwitadaud7767
    @mwitadaud7767 6 лет назад +1

    thanks alot.

  • @cherajanesumampong809
    @cherajanesumampong809 7 лет назад

    atal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\php\connect.php:6 Stack trace: #0 {main} thrown in C:\xampp\htdocs\php\connect.php on line 6
    Why ? :(

  • @vaishakvaishu1151
    @vaishakvaishu1151 6 лет назад +1

    India❤

  • @richardkaymwanza1851
    @richardkaymwanza1851 7 лет назад +1

    any help pliz,how do i create a database for my website

  • @priyankawarrier6162
    @priyankawarrier6162 6 лет назад

    I tried this but It didnt get connected. (localhost/php/connect.php) This is not getting connected. Please help.

    • @SolutionConeOfficial
      @SolutionConeOfficial  6 лет назад

      What error do you see?

    • @priyankawarrier6162
      @priyankawarrier6162 6 лет назад

      Solution Cone - it's not getting connected..I tried the same which is shown in the video. Please show me other solution for getting g it connected.

  • @HEMANTBISHT1000
    @HEMANTBISHT1000 7 лет назад

    love you buddy :D

  • @sharifabahar6257
    @sharifabahar6257 7 лет назад

    Thank you soooo much . May you help me? I got this error :
    Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in C:\xampp\htdocs\youtube\database\connect1.php on line 11
    Connected successfully
    This is my code :

  • @arielpineda8101
    @arielpineda8101 7 лет назад

    Why will it display "connected" but shows errors?

  • @krishnakabra3836
    @krishnakabra3836 3 года назад +1

    Quality of video in not up to mark

  • @mohammadihtishamhaider
    @mohammadihtishamhaider 7 лет назад

    plz give me the solution
    where is connect.php fil?

  • @AnSi97
    @AnSi97 8 лет назад +1

    Can you help me trough skype?

  • @akashdewangan7582
    @akashdewangan7582 5 лет назад

    #Akashdewangan
    Nice video good job...👍

  • @Kittukidz
    @Kittukidz 3 года назад +1

    Syntax error😔😔

  • @jesithrajasinghs1396
    @jesithrajasinghs1396 6 лет назад

    Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\form\insert.php on line 2
    Could not connect: Access denied for user 'root'@'localhost' (using password: YES)

  • @whitemamba00
    @whitemamba00 8 лет назад +1

    need help on skype

  • @sarahdiana1081
    @sarahdiana1081 6 лет назад

    To much adds!!

  • @HorizonGBRS
    @HorizonGBRS 8 лет назад +1

    Can I have a bit of help as well please on Skype.

  • @shwetachavan751
    @shwetachavan751 6 лет назад

    localhost is not running

  • @muhammadbilalraza8530
    @muhammadbilalraza8530 6 лет назад

    mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers

  • @annakatrinasimbahon4060
    @annakatrinasimbahon4060 6 лет назад

    Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in C:\xampp\htdocs\login\process.php:9 Stack trace: #0 {main} thrown in C:\xampp\htdocs\login\process.php on line 9