Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By sasha_bolcina

Thread: submit multiple rows at a time

  1. #1
    Senior Member
    Join Date
    Mar 2011
    Posts
    104
    Member #
    27314
    Liked
    6 times
    i have a php generated form

    PHP Code:
     <form action='step2.php' method="post" name='frm<? echo $socialid?>' id="frm_step2">
           <?
          $result 
    mysql_query("SELECT * FROM socials WHERE network not in (SELECT network FROM networks WHERE user='$_SESSION[user_id]') ");

    while(
    $socialrow mysql_fetch_assoc($result)){

        
    $socialid=$socialrow['id'];
        
    $socialnet=$socialrow['network'];
        
    ?>
       <a href="#" class="edit_<? echo $socialnet;?>"><img src="smallicons/<? echo $socialnet;?>.png" width="30" alt="<? echo $socialnet;?>" /></a>
        <div class="table_<? echo $socialnet;?>">the full url to your <? echo $socialnet;?> profile:<br />
        <input type='hidden' value='<? echo $socialnet;?>' name='network'/>
         <input type='text' name='urltonet'/> <br/>
        </div>

    <?
    }
        
    ?>
      <br />  <input type='submit' value='enter' />
      </form>
    basicly for every social network in the database it creates a form where the user needs to fill in their url to their profile
    so if the user still has to fill in 2 network urls, it will show two forms , one for each with one submit button

    so if the user fills in both text boxes it will need to insert these values in the same database

    any idea or help on how to insert thes in the db please?
    below my database:
    CREATE TABLE IF NOT EXISTS `networks` (
    `user` int(30) NOT NULL,
    `network` varchar(30) NOT NULL,
    `username` varchar(30) NOT NULL default 'not known',
    `url` varchar(300) NOT NULL,
    `user_name` varchar(30) NOT NULL,
    `netid` int(11) NOT NULL auto_increment,
    PRIMARY KEY (`netid`),
    UNIQUE KEY `netid` (`netid`),
    UNIQUE KEY `netid_2` (`netid`),
    UNIQUE KEY `netid_3` (`netid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=239 ;

  2.  

  3. #2
    Junior Member
    Join Date
    Jun 2011
    Location
    Singapore
    Posts
    3
    Member #
    28242
    Liked
    1 times
    ehm change your inputbox name become like "urltonet[]" :
    [COLOR=rgb(0, 0, 0)]<input type='text' name='urltonet[]'/>[/COLOR]

    in [COLOR=rgb(0, 0, 0)]step2.php , just get the data like this :[/COLOR]
    PHP Code:
    <?
    $url_list
    $_POST['urltonet'];
    if(
    $url_list){
       foreach(
    $url_list as $url){
            if(
    $url){
                
    // do insert to database
            
    }
       }
    }
    ?>


    with do this "urltonet[]" , when you get the data from PHP, it will automatically become array

  4. #3
    Member
    Join Date
    Jul 2014
    Posts
    33
    Member #
    39531
    Hello.......................click on this link solution for multiple rows submit at a time.

    How to insert bulk data (multiple rows) to a SQL Server database using ASP.NET. - DotNet - awesome

  5. #4
    Senior Member sasha_bolcina's Avatar
    Join Date
    Sep 2014
    Location
    Serbia
    Posts
    274
    Member #
    40099
    Liked
    47 times
    riyaz123, thats old post and issue is php script, not asp.
    You really don't need to answer EVERY post on the forum.
    Vapr_Arts likes this.

  6. #5
    Member
    Join Date
    Jul 2014
    Posts
    33
    Member #
    39531
    Hello.......................this lionk could help you so please click on
    this link to resolve your problems.

    How to insert bulk data (multiple rows) to a SQL Server database using ASP.NET. - DotNet - awesome


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:58 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com