help in sending php array to mysql table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • psycho007
    New Member
    • Nov 2008
    • 17

    #16
    i added a ',' at the end of the $newValue so that each entry into the table field would be seporated with a , as shown as :

    [php]
    $newValue .= $row['item'] .= $row['cost'].=',';
    [/php]

    My next stage would be then to retreive the string as a whole and use the explode function to seporate each entry via a comma.

    would it be something like

    [php]
    explode(',', $row['item']);
    [/php]

    cut a long story short I have been asked to create a web based internal ordering system for a local Pizza delivery company. the total_orders table is a temporary table which holds exactly what the customer would like. then using the code you have helped me with, it will then be inserted into the orders_complete table for later reference, so for example if the casher needs to re print the customer receipt or the kitchen check they can do.

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #17
      you make me curious. I like to have a look at the complete code, there seems room for improvement (or comments). you could also PM the code to me.

      Comment

      • psycho007
        New Member
        • Nov 2008
        • 17

        #18
        I bet your right, as im new i bet i could probily cut half the code down to achully what i am using. ive been working on it for nearly 2 months now, and have learnt a lot, well not enough to overcome your help with was greatfully received :o) I dont mind, i think you would probily laugh at the amount of if and else if statements im using,LOL.

        I would like to add you to my Buddy's list of thats ok with you? how would you want me to pass the full code to you?

        Comment

        • Dormilich
          Recognized Expert Expert
          • Aug 2008
          • 8694

          #19
          Originally posted by psycho007
          I would like to add you to my Buddy's list of thats ok with you? how would you want me to pass the full code to you?
          one - that ok with me
          two - do as you desire, you can contact me via my member details (click on the name...)
          Originally posted by psycho007
          i think you would probily laugh at the amount of if and else if statements im using,LOL.
          I bet you'd laugh about my code, I had written after learning php for 2 months, too (so would I now)

          Comment

          • psycho007
            New Member
            • Nov 2008
            • 17

            #20
            ha, you should see my database.sql text for creating the tables LOL

            theres about 15 tables or so.

            Comment

            • psycho007
              New Member
              • Nov 2008
              • 17

              #21
              so, whats your thoughts on retreiving the array and seporating each line using the comma. do you think the explode function is the best way forward for this?

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #22
                can't say that without the full code. there is always (nearly) more than one way to solve a problem.

                Comment

                • psycho007
                  New Member
                  • Nov 2008
                  • 17

                  #23
                  ok i will get the code to you tomorrow if thats ok? getting a little late now :o(

                  thank you again for helping me out so rapidly. You should be in a programming job :o)

                  Comment

                  • Dormilich
                    Recognized Expert Expert
                    • Aug 2008
                    • 8694

                    #24
                    Originally posted by psycho007
                    ok i will get the code to you tomorrow if thats ok? getting a little late now :o(
                    that leaves me now some time for watching some more slayers episodes
                    Originally posted by psycho007
                    thank you again for helping me out so rapidly. You should be in a programming job :o)
                    sometimes i wish it would

                    one last question for today: is the pizza good?

                    Comment

                    • psycho007
                      New Member
                      • Nov 2008
                      • 17

                      #25
                      LOL yes, definatly haha its the best pizza in town :o)

                      hehe

                      if you dont mind, tomorrow I will post you the total.php

                      basically im having problems in removing a single row from the order_total table

                      Comment

                      Working...