title: register data from erlang to table mysql
body: <p>I have a table in mysql named <strong>person</strong>
  this a simple code of insertion of data in the table person</p>
  <pre><code>$id = &quot;1&quot;;
  $firstname = &quot;afif&quot;;
  $lastname = &quot;kaled&quot;;
  $test = mysql_connect(&quot;localhost&quot;, &quot;root&quot;, &quot;root&quot;);
      if ($test) {
          mysql_select_db(&quot;basetest&quot;, $test);
      }
  
  
      $sql = &quot; INSERT INTO `person` SET
              `id` = '&quot; . $id . &quot;',
                           `firstname` = '&quot; . $firstname . &quot;',
              `lastname` = '&quot; . $lastname . &quot;' &quot;;
              
  
      @mysql_query($sql, $test);
  </code></pre>
  <p>I want to modify this function</p>
  <pre><code>test()-&gt;
  
  Id =&quot;11&quot;,
  Firstname =&quot;afif&quot;,
  Lastname =&quot;kaled&quot;,
  
  %% here I want to register this data in the table person .
  </code></pre>
  <p>so the table person will have this data</p>
  <p><strong>11   afif  kaled</strong></p>
  <p>I want to know if is it possible to register data from erlang to table mysql</p>
  <p>I have already done an example of transfer data from erlang to txt file with this code :</p>
  <pre><code>exporttxt()-&gt;
      F = fun() -&gt; mnesia:foldl(fun(X,Acc) -&gt; [X|Acc] end, [],person) end,
      {atomic,L} = mnesia:transaction(F),
      file:write_file(&quot;test.txt&quot;,[io_lib:format(&quot;~p\t~p\t~p~n&quot;,[F1,F2,F3]) || 
                       #person{id = F1,firstname = F2,lastname = F3} &lt;- L]).
  </code></pre>
  <p><strong>but now as I already said I want to know is it possible or not to send data from erlang to a table in mysql</strong></p>