how to translate this PHP code to PDO form , brcause i am getting undefined function in PHP 7 (using XAMPP)? :  this is my PHP file, but i am getting fatal error : undefined function mysql_connect, i have searched it and it looks like i have to use PDO instead of mysql_connect on PHP 7 , and i dont know how so i need help please, i want this code as PDO, thanks for your time 

    <?php

    // connection , which gives fatal exception : undefined function..

    $con = mysql_connect("localhost",'root',''); 

    //error handling

    if (!$con)

     {

	  die("Could not connected".mysql_error());  else 
    {

    //select the DB name in PhpMyAdmin

      mysql_select_db("tm-mobile",$con);

    //Vlidation

    if (!empty($_POST['owner_name']) && !empty($_POST['owner_email'])) 
    {

      $owner_id=$_POST['owner_id'];

      $owner_name=$_POST['owner_name'];

      $owner_email=$_POST['owner_email'];

      $owner_password=$_POST['owner_password'];

      $market_name=$_POST['market_name'];

    //SQL statement

    $sql =  "UPDATE owner_table SET owner_id = '$owner_id',owner_name = 
  
      '$owner_name' , owner_email = '$owner_email', owner_password = 

      '$owner_password'  ,  market_name = '$market_name' ";

      $re = mysql_query ($sql,$con);

    //Close the Connection

    mysql_close();

       }

    }

    ?>