insert 2 text data fields into one field MySQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Noorain
    New Member
    • Mar 2008
    • 57

    #1

    insert 2 text data fields into one field MySQL

    Phone or A/C id data insert into one field.
    Code:
    <input type="text" name="phone" id="ph" onKeyUp="document.getElementById('ac').disabled=!!this.value.length;" onFocus="this.value='017'" size="20" maxlength="11" />
    <input type="text" name="acc"  id="ac" onKeyUp="document.getElementById('ph').disabled=!!this.value.length;" onFocus="this.value='1.'"  size="20" maxlength="10" />
    Please help me how to do
    Last edited by ronverdonk; Apr 2 '08, 01:43 PM. Reason: code tags!!
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Originally posted by Noorain
    Phone or A/C id data insert into one field.

    <input type="text" name="phone" id="ph" onKeyUp="docume nt.getElementBy Id('ac').disabl ed=!!this.value .length;" onFocus="this.v alue='017'" size="20" maxlength="11" />

    <input type="text" name="acc" id="ac" onKeyUp="docume nt.getElementBy Id('ph').disabl ed=!!this.value .length;" onFocus="this.v alue='1.'" size="20" maxlength="10" />

    Please help me how to do
    What do you want to achieve now?

    (You could have asked in your previous thread, no need to double post)

    Comment

    • Noorain
      New Member
      • Mar 2008
      • 57

      #3
      Originally posted by hsriat
      What do you want to achieve now?

      (You could have asked in your previous thread, no need to double post)
      i want to insert data in database.(php & mysql)

      At a one time phone or a/c id insert in database. For this i have to use two textbox.
      please help me

      Comment

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #4
        Originally posted by Noorain
        i want to insert data in database.(php & mysql)

        At a one time phone or a/c id insert in database. For this i have to use two textbox.
        please help me
        This example may help you.

        Comment

        • ronverdonk
          Recognized Expert Specialist
          • Jul 2006
          • 4259

          #5
          Please enclose your posted code in [code] tags (See How to Ask a Question).

          This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

          Please use [code] tags in future.

          MODERATOR

          Comment

          • ronverdonk
            Recognized Expert Specialist
            • Jul 2006
            • 4259

            #6
            ..i want to insert data in database.(php & mysql)
            When you do not know how to insert data, via PHP, in a MySQL database, I suggest that you take some PHP and MySQL tutorials first, before you continue.

            Then come back to ask question when having problems, not to ask for ready code on an insert.

            Ronald

            Comment

            • Noorain
              New Member
              • Mar 2008
              • 57

              #7
              Originally posted by hsriat
              This example may help you.
              Originally posted by ronverdonk
              When you do not know how to insert data, via PHP, in a MySQL database, I suggest that you take some PHP and MySQL tutorials first, before you continue.

              Then come back to ask question when having problems, not to ask for ready code on an insert.

              Ronald
              I know how to insert. You don't get what my ques.

              Normally we use text box for insert data into database. suppose i use 3 textbox for name, nick name, phone. For this my table is user_id( int 6), user_name(varch ar 100), user_phone(int 11). If i insert nick name it also add in user_name field.

              Name AA
              Nick Name
              Phone 123
              For this
              insert into user values('','AA', 123)

              Name AA
              Nick Name BB
              Phone 123
              For this how to insert. I think now u understand what i want.

              Comment

              • hsriat
                Recognized Expert Top Contributor
                • Jan 2008
                • 1653

                #8
                As far as I can understand you, I guess you want to update the database row instead of inserting a new row. Is it?
                If that's the case you can have a look at this tutorial.
                If not, then please explain it properly.

                Regards,
                Harpreet

                Comment

                • Noorain
                  New Member
                  • Mar 2008
                  • 57

                  #9
                  Originally posted by hsriat
                  As far as I can understand you, I guess you want to update the database row instead of inserting a new row. Is it?
                  If that's the case you can have a look at this tutorial.
                  If not, then please explain it properly.

                  Regards,
                  Harpreet
                  Thanks
                  i can slove my problem.

                  Comment

                  Working...