Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-04-2008, 02:11 AM
New kid on the block
 
Join Date: Mar 2008
Location: P.jaya
Posts: 6
Rep Power: 0
emnieysh is on a distinguished road
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.....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-04-2008, 10:30 AM
Novice Webmaster
 
Join Date: Oct 2005
Location: KLC
Posts: 89
Rep Power: 37
afroman is on a distinguished road
Send a message via ICQ to afroman Send a message via Yahoo to afroman
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tolong saya!!(Cam ne nak insert multiple record in sql) emnieysh Website Programming 11 08-04-2008 03:08 PM
insert data into multiple table azmaliya Website Programming 18 06-08-2005 11:02 AM
checking multiple emails from multiple domain mrbadak Mamak Stall 4 28-06-2005 08:59 PM
erm... baru nak blajar bole tolong?? zube Graphic Design 1 28-09-2004 12:07 AM
insert multiple data vash Website Programming 4 28-04-2004 02:48 PM



All times are GMT +8. The time now is 09:19 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

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