1 Reply Latest reply: Jan 3, 2011 1:52 AM by Opal RSS

    submit data on mysql using php or html

    815170
      Hi,

      I have a mysql database and i insert data in the table using html form which uses a php script.
      How can i insert data into the table from java me?
      my php file looks like this

      <?php

      $con = mysql_connect("mysql10.000webhost.com","a7456565_zzz","zzz");
      if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }

      mysql_select_db("a7456565_db", $con);

      $sql="INSERT INTO GPS (lat,lon)
      VALUES
      ('$_POST[lat]','$_POST[lon]')";

      if (!mysql_query($sql,$con))
      {
      die('Error: ' . mysql_error());
      }
      echo "1 record added";
      mysql_close($con)

      ?>