Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End how to insert multiple rows in one table

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #33119
    The-Marshal
    Member

    Hi all,

    Could you tell me How to insert multiple rows in one table ?

    Thanx in advance ☺

    #73010
    ylex1
    Participant
    starts a new row

    starts a cell

    Use it like this:


    ylex
    #72993
    The-Marshal
    Member

    Thanx ylex1

    Sorry ☺

    i meant Insert multiple rows in DataBase table

    Like

    we assume we created table called info


    $Query = INSERT INTO info (name, age) VALUES ('$name', '$age');
    $SQL = mysql_query($Query);

    This query will insert on row in the SQL table

    then insert new data in the form and insert again that’s take long time

    i don’t know the idea to insert multiple row in one time

    #72964
    The-Marshal
    Member

    I tried this and work with me


    include"config.php";

    /*
    CREATE TABLE `multiple` (`m_id`,`m_name`,`m_email`);
    */

    if($_REQUEST){
    $name = $_POST;
    $email = $_POST;

    $name1 = $_POST;
    $email1 = $_POST;

    $name2 = $_POST;
    $email2 = $_POST;

    $SQL = "INSERT INTO multiple ";
    $SQL .= "(`m_name`, `m_email`) ";
    $SQL .= "VALUES ";
    $SQL .= "('$name','$email'), ";
    $SQL .= "('$name1','$email1'), ";
    $SQL .= "('$name2','$email2')";

    $Query = mysql_query($SQL) or die(mysql_error());

    if($Query){
    echo"

    MULTIPLE INSERT IS DONE !

    ";
    }
    }


    ?>

    First Name:



    First Email:




    Second Name:



    Second Email:




    Third Name:



    Third Email:






    but in need it more dynamically

    like in array when i make form through this form can add more records by JQuery such




    and dynamically add the values of this records in the mysql table ??

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.