php tutorials in hindi / urdu – 46 – how to connect to database in php mysql




For all my tutorials go to: http://websofttutorials.com/ For any question go to: http://forum.websofttutorials.com/ In this tutorial I will teach you how to connect to …

Original source


23 responses to “php tutorials in hindi / urdu – 46 – how to connect to database in php mysql”

  1. <?php
    mysql_connect('localhost','root','');
    ?>
    then run brouser
    Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:xampphtdocstestconnection.php:2 Stack trace: #0 {main} thrown in C:xampphtdocstestconnection.php on line 2

  2. Hi,
    Fatal error: Uncaught Error: Call to undefined function mysql_connect() in line 6

    and code is:

    <?php
    $host='localhost';
    $username='root';
    $password='';
    $dbname='student';
    @mysql_connect($host,$username,$password);
    @mysql_select_db($dbname);
    ?>
    Please help me

  3. try{
    $con = new PDO ("mysql:host=localhost;dbname=students_record","root","");
    if(isset($_POST['submit'])){
    $name = $_POST['name'];
    $email = $_POST['email'];
    $add = $_POST['address'];
    $adm = $_POST['joining_date'];
    //$month = $_POST['month'];
    //$year = $_POST['year'];

    $insert = $con->prepare("INSERT INTO students_record (name,email,address,joining_date) values(:name,:email,:address,:joining_date)");
    $insert->bindParam(':name',$name);
    $insert->bindParam(':email',$email);
    $insert->bindParam(':address',$add);
    $insert->bindParam(':joining_date',$adm);
    //$insert->bindParam(':month',$month);
    //$insert->bindParam(':year',$year);
    $insert->execute();
    }
    }
    catch(PDOException $e)
    {
    echo "error".$e->getMessage();
    }

    data wamp server se offline project me to insert ho raha h but. hosting wale phpmyadmin me nahi ho raha insert.

  4. hello sir i whatch video of connect database but it not working could u give me solution for that
    <? php
    mysql_connect('localhost','root','') or die();

    mysql_select_db('students')
    ?>
    my database is that of u
    and when i give any wrong password it not give any error;

  5. sir will you please help me i am getting the following error when i wants to connect to mysql db..

    Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:xampphtdocsCMSincludesdatabase.php:3 Stack trace: #0 C:xampphtdocsCMSindex.php(26): include() #1 {main} thrown in C:xampphtdocsCMSincludesdatabase.php on line 3

  6. sir muje sey nah horaha hy php connection.php ki file mai ney banali hy but muje sey sql database connection mai yeh error display horaha hy kai karna hoga muje samja nah araha hy ap muje guide karey please Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:xampphtdocsphpsignupformconnection.php:2
    Stack trace:
    #0 {main}
    thrown in C:xampphtdocsphpsignupformconnection.php on line 2 likha araha hy jb bhi SQL sey saat data base connect karney jao toh please tell me my question agar ap ka skype hy toh muje yeh bataha dijye please i need help you

  7. +websofttutorials mujy eak problem ah rhi hai AUTO_INCREMENT ki means eak baar koi ID add ho to 2nd ID Auto add nhi ho rhi.. Then 2nd add krny k liye mujy U_id ko change krna parta hai jb k db mein AUTO_INCREMENT U-id pr lagya howa hai:( ????
    $query.= "(U_id,U_name,U_lastname,U_age,U_email,U_password) ";
    $query.= " VALUES (1,'{$fname}','{$lname}',{$age},'{$email}','{$pass}')";

Leave a Reply