#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Posts
    9
    Rep Power
    0

    Question How to get the info "array" created by the Post command stored into a php/mysql db.


    A little help please. I have a form that collects the ingredients for recipes entered into a cookbook.

    I am using $_Post to collect and display the info just entered in a form to form.php.

    Can you help me with how to get the info "array" created by the $_Post command stored into a php/mysql db.

    It has been a long time since I have used any of this about 18 yrs.

    This is the Java script used to create each input box. Three are required for each ingredient "Name", "Amount", "Measure". New row created each time Add New Input is clicked.

    Thank You for any help you can give.
    Snickers123

    Code:
    var container = document.getElementById('ingredients');
            
            //Create the label
            var e = document.createElement('label');
            var dv = document.createElement('div');
            e.innerHTML = 'Name:';
            dv.appendChild(e);
            
            //Create the textbox
            e = document.createElement('input');
            e.setAttribute('type', 'text');
            e.setAttribute('name', 'ingre[][name]');
            dv.appendChild(e);
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    please show us the PHP code and the table(s) you currently have.

    For the database interaction, use PDO. Do not use the ancient mysql_ functions that are still recommended by bad tutorials. They're long obsolete and will be removed sooner or later.

IMN logo majestic logo threadwatch logo seochat tools logo