android studio + php need help updating table

Hello I am writing code to take data from android app (strings) and send them to php file which holds code of mysqli to insert into mysql database in phpmyadmin the thing is I use similar code to register user, login user everything works fine but then I try use code to update table I get no erros, but data is not updated in naryste field of User table please help me out . Here are the codes :

Activity naryste code which activates ServerRequest class method :

uzsisakyti.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Global.naryste = trukme +" "+ rad +" "+ kaina.getText().toString(); registernaryste(); } }); public void registernaryste(){ ServerRequests storenaryste = new ServerRequests(this); storenaryste.storenarystebackground(); } }

ServerRequest class I put all three methods to show u example first two works fine last one uses my Update :

public class ServerRequests { ProgressDialog progressDialog; public static final int CONNECTION_TIMEOUT = 1000 * 15; public static final String SERVER_ADDRESS = "http://soundflow.hostei.com/"; public ServerRequests(Context context) { progressDialog = new ProgressDialog(context); progressDialog.setCancelable(false); progressDialog.setTitle("Processing..."); progressDialog.setMessage("Please wait..."); } public void storeUserDataInBackground(User user, GetUserCallback userCallBack) { progressDialog.show(); new StoreUserDataAsyncTask(user, userCallBack).execute(); } public void fetchUserDataAsyncTask(User user, GetUserCallback userCallBack) { progressDialog.show(); new fetchUserDataAsyncTask(user, userCallBack).execute(); } public void storenarystebackground(){ progressDialog.show(); new Storenaryste().execute(); } /** * parameter sent to task upon execution progress published during * background computation result of the background computation */ public class StoreUserDataAsyncTask extends AsyncTask<Void, Void, Void> { User user; GetUserCallback userCallBack; public StoreUserDataAsyncTask(User user, GetUserCallback userCallBack) { this.user = user; this.userCallBack = userCallBack; } @Override protected Void doInBackground(Void... params) { ArrayList<NameValuePair> dataToSend = new ArrayList<>(); dataToSend.add(new BasicNameValuePair("vardas", user.vardas)); dataToSend.add(new BasicNameValuePair("pavarde", user.pavarde)); dataToSend.add(new BasicNameValuePair("grupe", user.grupe)); dataToSend.add(new BasicNameValuePair("pastas",user.email )); dataToSend.add(new BasicNameValuePair("slaptazodis",user.slaptazodis )); HttpParams httpRequestParams = getHttpRequestParams(); HttpClient client = new DefaultHttpClient(httpRequestParams); HttpPost post = new HttpPost(SERVER_ADDRESS + "Register1.php"); try { post.setEntity(new UrlEncodedFormEntity(dataToSend)); client.execute(post); } catch (Exception e) { e.printStackTrace(); } return null; } private HttpParams getHttpRequestParams() { HttpParams httpRequestParams = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpRequestParams, CONNECTION_TIMEOUT); HttpConnectionParams.setSoTimeout(httpRequestParams, CONNECTION_TIMEOUT); return httpRequestParams; } @Override protected void onPostExecute(Void result) { super.onPostExecute(result); progressDialog.dismiss(); userCallBack.done(null); } } public class fetchUserDataAsyncTask extends AsyncTask<Void, Void, User> { User user; GetUserCallback userCallBack; public fetchUserDataAsyncTask(User user, GetUserCallback userCallBack) { this.user = user; this.userCallBack = userCallBack; } @Override protected User doInBackground(Void... params) { ArrayList<NameValuePair> dataToSend = new ArrayList<>(); dataToSend.add(new BasicNameValuePair("pastas", user.email)); dataToSend.add(new BasicNameValuePair("slaptazodis", user.slaptazodis)); HttpParams httpRequestParams = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpRequestParams, CONNECTION_TIMEOUT); HttpConnectionParams.setSoTimeout(httpRequestParams, CONNECTION_TIMEOUT); HttpClient client = new DefaultHttpClient(httpRequestParams); HttpPost post = new HttpPost(SERVER_ADDRESS + "FetchUserData1.php"); User returnedUser = null; try { post.setEntity(new UrlEncodedFormEntity(dataToSend)); HttpResponse httpResponse = client.execute(post); HttpEntity entity = httpResponse.getEntity(); String result = EntityUtils.toString(entity); JSONObject jObject = new JSONObject(result); if (jObject.length() != 0){ Log.v("happened", "3"); String name = jObject.getString("vardas"); String age = jObject.getString("pavarde"); String grupe = jObject.getString("grupe"); returnedUser = new User(name, age,grupe, user.email, user.slaptazodis); } } catch (Exception e) { e.printStackTrace(); } return returnedUser; } @Override protected void onPostExecute(User returnedUser) { super.onPostExecute(returnedUser); progressDialog.dismiss(); userCallBack.done(returnedUser); } } private class Storenaryste extends AsyncTask<Void, Void, Void> { @Override protected Void doInBackground(Void... params) { ArrayList<NameValuePair> dataToSend = new ArrayList<>(); dataToSend.add(new BasicNameValuePair("pastas",Global.elpastas)); dataToSend.add(new BasicNameValuePair("slaptazodis",Global.naryste)); dataToSend.add(new BasicNameValuePair("naryste",Global.naryste)); HttpParams httpRequestParams = getHttpRequestParams(); HttpClient client = new DefaultHttpClient(httpRequestParams); HttpPost post = new HttpPost(SERVER_ADDRESS + "Naryste.php"); try { post.setEntity(new UrlEncodedFormEntity(dataToSend)); client.execute(post); } catch (Exception e) { e.printStackTrace(); } return null; } private HttpParams getHttpRequestParams() { HttpParams httpRequestParams = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpRequestParams, CONNECTION_TIMEOUT); HttpConnectionParams.setSoTimeout(httpRequestParams, CONNECTION_TIMEOUT); return httpRequestParams; } @Override protected void onPostExecute(Void result) { super.onPostExecute(result); progressDialog.dismiss(); } } }

My naryste.php code :

<?php $con=mysqli_connect("*","*","*","*"); $pastas = $_POST["pastas"]; $slaptazodis = $_POST["slaptazodis"] $naryste = $_POST["naryste"]; $statement = mysqli_prepare($con, "UPDATE User set naryste=? where pastas=? AND slaptazodis=?"); mysqli_stmt_bind_param($statement, "sss", $naryste, $pastas, $slaptazodis); mysqli_stmt_execute($statement); mysqli_stmt_close($statement); mysqli_close($con); ?>

And my Register1.php as an example which works:

<?php $con=mysqli_connect("*.com","*","*","*"); $vardas = $_POST["vardas"]; $pavarde = $_POST["pavarde"]; $amziaus_grupe= $_POST["grupe"]; $el_pastas= $_POST["pastas"]; $slaptazodis= $_POST["slaptazodis"]; $statement = mysqli_prepare($con, "INSERT INTO User (vardas , pavarde , grupe, pastas,slaptazodis) VALUES (?, ?, ?, ?, ?)"); mysqli_stmt_bind_param($statement, "sssss", $vardas , $pavarde , $amziaus_grupe, $el_pastas, $slaptazodis); mysqli_stmt_execute($statement); mysqli_stmt_close($statement); mysqli_close($con); ?>

Category:php Views:3 Time:2018-10-07

Related post

  • i keep getting windows download failed error 646 i need help updateing 2013-08-03

    i keep getting windows download failed error 646 i need help updateing --------------Solutions------------- Hi, Right Click on the Updates and then go here and manually put in the KBxxxxxx article to manually download them. Microsoft Download Center

  • Need help Updating data from two database and two tables 2010-08-11

    I am trying to update data from another table/databases Database 1 = Client, Table 1 = Customer$ Account Number, Zip and Phone Database 2 = Site10 and Insurance Need to update Site 10 with Zip from Database 1 which is the client Need Help???? -------

  • Need help updating Pivot Tables with new data 2012-02-11

    I have several pivot tables on one worksheet that I need to update with new data on a regular basis. The new data may have more rows that the original. There are ~20 different tables. Should I create different worksheets for each pivot table, so that

  • Oracle SQL: Need help updating a record based on a sum of values in child tables 2011-05-25

    Let's says I have a set of tables that match the following scenario: Crates have boxes Boxes have buckets Buckets hold a numeric value called Pieces A crate holds a numeric value called TotalPieces that is the sum of all the pieces in all the buckets

  • Need help with tables, forms, and sub forms created in Access 2007 2013-05-19

    I have been requested by the local churches to help them create a database to help them with the Food Distribution to the homeless and poor families suffering from lack of jobs during this severe economic time in California. Basically all they need i

  • Need help joining table 2008-11-25

    I have a function that exports a table to CSV and in the query I set which fields will export. Here is the query: SELECT lname, fname, email, address1, address2, city, state, zip, venue_id, dtelephone, etelephone, tshirt FROM volunteers_2009 The fiel

  • Access DB query - need help updating certain records 2009-01-30

    I have an access DB which we use to track tickets. Each ticket may have multiple occurrences because of different programming changes associated with that ticket. Each record also has a program_type field which is SVR or VB. Example: 123456 - SVR - S

  • Need to update table row from UDF in SQL Server 2010-01-19

    I am using a function in the view for getting some result sets. In that function, based on some condition need to update rows to the database table. Can anyone tell me, How can I do this --------------Solutions------------- You cannot do this using S

  • Need help update Error code: 643 2013-05-03

    Original title: need help while trying to update " Security update for microsoft.Net framework 1.1 sp1 on windowsXP windows vista and window server 2008 x86 (kb2416447) I recieve error code 643 and update fails. Vista operating system --------------S

  • Need help with tables in Access 2013-10-25

    I am trying to make a table that gets its information (for some fields) from another table. Can someone please tell me which "type" of field this should be? I have the sense that this is pretty simple, but that I am missing something in all the instr

  • PHP - Need help inserting arrays into Associative arrays at given keys 2011-06-28

    Ok, so I have an array like so: $buttons = array( 'home' => array( 'title' => $txt['home'], 'href' => $scripturl, 'show' => true, 'sub_buttons' => array( ), 'is_last' => $context['right_to_left'], ), 'help' => array( 'title' =

  • Need help updating an Excel formula 2012-11-12

    I need help udating a formula I'm using in a worksheet. The formula is: =IF(OR('Hskp Assign'!C10={"","BLOCK"},AND('Hskp Assign'!C10="S",ISNUMBER('Hskp Assign'!B10))),'Hskp Assign'!B10, IF('Hskp Assign'!C10="DIRTY",2,"")) This formula works great but

  • PHP - Need Help With Logic 2009-09-01

    I'm currently working on a PHP/MySQL script that does the following, in this order: 1) Checks DB for any videos that need converting 2) Once determined that a video needs to be converted, it begins to convert *3) Notifies the "creator" of video that

  • Need help with table view detail view. I can't seem to write values to the UILabel's text property? 2010-07-07

    I have a TableView setup as my "root view controller" and a detail view controller called "DetailController" to allow me to display the detail view for what the user selects in the main table view. The navigation is working correctly - when I select

  • Need help Creating Table from query results 2011-04-10

    I'm having trouble creating a table from my query results. I have this code: // Model <?php class Search_Employee extends CI_Model { function getAll() { $searchterm = $this->name = $_POST['empname']; $this->db->like('first_name', $searcht

  • Need help updating many cells when changing to/from text and number formats 2013-02-24

    While troubleshooting large/complex spreadsheets, I sometimes need to format a column or group of cells (to copy/move the formulae without updating relative references, or to test the impact on a dependent set of cells, for example) then change it ba

  • Need help on Table set up for SINGLE Payment of Many Invoices 2013-03-10

    Payment / Invoicing Overview The business dictates a Single Monthly Payment to be made against multiple monthly Invoices and I need feedback if my current tables (especially invoices, payments) are set up right. Notes: 1. We're not tracking invoice l

  • Need help in table creation for dropdown list 2009-07-16

    I have table with name Dates. Fields are: Date of Joining Previous Date of Visit Number of Visit Reffered Department For Date of Joining and Previous Date of visit fields, I'm entering the data from drop down list. Like: Select Day, Select Month, Sel

  • php need help choosing player and format 2011-01-22

    I am in requirement of a player & video format that is supported on all desktop/laptop browser, and even on android and iphone, server is based on PHP What I am right now using is .mov with H.264, which does not work on android, and sometimes not

  • Ajax Live Search with Php - Need help 2011-03-23

    Index.php <script type="text/javascript">$(function() {$('input[type=text]').focus(function() {$(this).val('')});});</script> <script type="text/javascript"> $(document).ready(function(){ $("input[type=radio]").click(function(){ $("

  • Developing a simple voting system in php need help 2011-03-26

    I need to set up a simple voting system for my application., My application consists of articles posted as well as comments. I would like to add voting abilities to both articles and comments and at the same time be able to sort comments based upon h

  • writing and reading .txt file using android on phonegap need help 2011-07-06

    Hello all i am very new to phonegap.. i want to create file and write file using on android using phonegap the below code not working for me... i've taken help from here this is my File.html that is located into *android_asset/www/File.html* <!DOC

  • simple xml php need help 2011-07-27

    I'm having trouble with simple xml to assign it as variable. Here is my code: $config = '../XML/config.xml'; $xml = simplexml_load_file($config); $cnt = count($xml->children()); for($i=0;i<=$cnt;$i++) { foreach($xml->item[$i]->attributes(

  • Need help aligning tables -HTML 2011-10-25

    This should be an easy one. Just so you know, I normally write java logic, so styling is not my cup of tea, but got to do it. Anyway I just got this: Im trying to get the tables to be side by side instead of on top of each other like this: Here's the

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.113 (s). 11 q(s)