php - How to insert data into mysql using android device? -


I am starting in the mysql database, I am trying to create an online database application in Android. This is a user registration application. I have tested this app with the emulator and it has successfully inserted data into the database. At the same time this app was tested with a real Android device and did not include data in the database. can go. Is this possible? How can I do this from the same offline server? I'm using wampserver version 2.5 My PHP code is given below

  & lt; Php $ servername = "localhost"; $ Username = "subtle"; $ Password = "subtle"; $ Dbname = "insert_user"; // Make connections $ conn = mysqli_connect ($ servername, $ username, $ password, $ dbname); If (! $ Conn) {dead ("Connection failure:". Mysqli_connect_error ()); } $ Name = $ _ POST ['user']; $ Passed = $ _ post ['pass']; $ Email = $ _ post ['email']; $ Flag ['code'] = 0; $ Sql ​​= "Include users (name, pass, email) values ​​('$ name', '$ pass', '$ email')"; If (mysqli_query ($ conn, $ sql)) {echo "new record successfully created"; } Else {echo "error:" $ sql "& lt; br & gt; . Mysqli_error ($ Conn); } Mysqli_close ($ conn); ? & Gt;  

logcat

< Div class = "post-text" itemprop = "text">

You need a restore API - Try this tutorial, may help


Comments

Popular posts from this blog

ffmpeg h264_omx encoder - libomxcore.so missing. - Raspberry Pi Forums

'setTime' was not declared in this scope

php - Class PDO not found in laravel 5.2 -