Results 1 to 2 of 2

Thread: Y tak bole access my thread previously...(insert multiple row)

  1. #1
    Join Date
    Mar 2008
    Location
    P.jaya
    Posts
    6
    Rep Power
    0

    Y tak bole access my thread previously...(insert multiple row)

    Y saya dah tak bley access my previous thread dlm forum ni...
    and can sumone plz help me regarding post array in multiple row??
    need to present dis 17 april..really need sumone coz i've stuck with dis prob bout a month...

    the quest:
    can we post array value to next page and add the value to sql??
    if can how should i do??
    plz.....

  2. #2
    Join Date
    Oct 2005
    Location
    KLC
    Posts
    91
    Rep Power
    172
    Quote Originally Posted by emnieysh View Post
    for example :

    i have 2 student

    Hasanah TT074921 5(marks)
    Syakirah TT074318 4(marks)

    *marks was a textbox fill..went i insert mark n submit it,
    only Syakirah TT074318 4 was insert into db..so how should i do to insert HASANAH n SYAKIRAH record in db..
    a few methods can be used. but easiest is to use array.
    Code:
    <input type="text" name="student[1]"...
    <input type="text" name="mark[1]"...
    
    <input type="text" name="student[2]"...
    <input type="text" name="mark[2]"...
    in the action script..

    Code:
    $student = $_POST['student'];
    
    foreach ($_POST['mark'] AS $i => $v) {
    
        mysql_query("INSERT INTO table VALUES ('%s', %d)", $student[$i],  $v);
    }
    btw, fine=elok/baik, find=jumpa/cari...
    klaatu barada nikto

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Thread couldn't access issue
    By yipguseng in forum FeedBack & Suggestion
    Replies: 6
    Last Post: 16-04-2008, 02:35 PM
  2. Tolong saya!!(Cam ne nak insert multiple record in sql)
    By emnieysh in forum Website Programming
    Replies: 11
    Last Post: 08-04-2008, 03:08 PM
  3. insert data into multiple table
    By azmaliya in forum Website Programming
    Replies: 18
    Last Post: 06-08-2005, 11:02 AM
  4. checking multiple emails from multiple domain
    By mrbadak in forum Mamak Stall
    Replies: 4
    Last Post: 28-06-2005, 08:59 PM
  5. insert multiple data
    By vash in forum Website Programming
    Replies: 4
    Last Post: 28-04-2004, 02:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112