Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7858043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:14:47+00:00 2026-06-02T21:14:47+00:00

i am sending two array list for example [P,Q,R,S,T,U,V] and [A,B,C,D,E,F,G] from android to

  • 0

i am sending two array list for example [P,Q,R,S,T,U,V] and [A,B,C,D,E,F,G] from android to php through url. On updating [P,Q,R,S,T,U,V] is replaced by [A,B,C,D,E,F,G] and updating taking place correctly. but in mysql database while updating first row i.e., A is updating correctly and from second row i.e, B to G for each update its getting extra space in the beginning of the each line
initially

   Before update  After update1    After2nd update       
        P            A               A
        Q             B                B
        R             C                C
        S             D                D
        T             E                E
        U             F                F
        V             G                G

i try this code

               <?php
             $old_menu_names=explode(',',preg_replace('/^.*\[(.*)\].*$/','$1',trim($_POST['menuname'], '[]')));
             $new_menu_names=explode(',',preg_replace('/^.*\[(.*)\].*$/','$1',trim($_POST['editmainmenu'], '[]')));
             mysql_connect("localhost", "root", "root");
             mysql_select_db("test");
             foreach ($old_menu_names as $key => $old_name)
             {
             $new_name = mysql_real_escape_string($new_menu_names[$key]);
             $old_name  = mysql_real_escape_string($old_menu_names[$key]);

             mysql_query("UPDATE `test` SET `menuname` = '$new_name' WHERE menucode = '$old_name'")
    or die('Error' . mysql_error());
            echo "Updated";
              }
             ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T21:14:49+00:00Added an answer on June 2, 2026 at 9:14 pm
    mysql_query("UPDATE `test` SET `menuname` = ltrim('$new_name') WHERE menucode = '$old_name'")
        or die('Error' . mysql_error());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been experimenting with sending messages from two .NET Windows Forms applications using
I'm sending sensor data from an android device to a TCP server in C#.
I have an ajax request sending some data to a php file: Ext.Ajax.request({ url:
I have two pages, one sending a file_get_contents request: $postdata = http_build_query( array('install' =>
I am trying to compile a code in C++ using code from : https://stackoverflow.com/questions/5953979/sending-and-receiving-array-using-mpi-part-2
When sending two intents (One through startService followed by another through startActivityForResult for the
I've spent the past two days just trying to enable the sending of email
Sending Email in Android using JavaMail API without using the default/built-in app I'm trying
I have two arrays consisting of a list emails which I need to send
I am sending a reference of an array variable which is initially empty. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.