Hello I've got a test table with title mytable with following data

id  name   surname
==================
1   sotos  val
2   john   rik
3   peter  ask

Just how can id export for instance the 2nd row in mysql using php understanding the id?

Use:

SELECT t.id,
       t.name,
       t.surname
  FROM MYTABLE t
 WHERE t.id = mysql_real_escape_string($id)

Reference:

PHP

<?php

  $query = "SELECT t.id,
                   t.name,
                   t.surname
              FROM MYTABLE t
             WHERE t.id = mysql_real_escape_string($id)";
  $result = mysql_query($query);

  while ($row = mysql_fetch_assoc($result)) {
    echo $row['id'];
    echo $row['name'];
    echo $row['surname'];
  }
?>

If by export you mean dump data into ready-to-use SQL query try that one:

$sql_query = shell_exec('x:\path\to\mysqldump.exe -t --compact -u DB_USERNAME --password=DB_PASSWORD DB_NAME mytable --where="id = 2"');

Will produce something similar to:

INSERT INTO `mytable` VALUES(2,'john','rik');