Hi,
I have a mysql database and i add string data to it using a web html form. The html form inserts data to the table using php which is here
how can i add data to it using JAVA ME?PHP Code:<?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)
?>
I add data using a html form which works fine.
I tried the following but is not working
Code:HttpConnection conn = ("http://www.test.it" + "?TextField=Hello&TextField2=Hello2&Submit=Submit"); conn.close();

Reply With Quote

