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

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 20-09-2002, 03:22 PM
kasih's Avatar
Novice Webmaster
 
Join Date: Sep 2002
Location: kl
Posts: 27
Rep Power: 0
kasih is on a distinguished road
Exclamation mcm mane nak insert array dalm database

mcm nie aku nak masuukan value tuk checkbox dalm databse...
nie contoh coding aku

<td width="693" height="1">
<p><b>: </b><input type="checkbox" name="CE[]" value="CE01">CE01 <input type="checkbox" name="CE[]" value="CE02">CE02
<input type="checkbox" name="CE[]" value="CE03">CE03 <input type="checkbox" name="CE[]" value="CE04">CE04
<input type="checkbox" name="CE[]" .

user leh klik bykla..ni aku pendekan..
ni pulak coding php aku.

<?php
$user = "chempaka";
$pwd = "kasih";
$db = "TMS";
$host = "chempaka";

$conn = mysql_connect($host,$user,$pwd);
mysql_select_db("TMS", $conn) or die(mysql_errno() . ": " . mysql_error() . "<br>");
?>
<p>
<?php

#this is processed when the form is submitted
#setup SQL statement

$CE=array();
$ce_txt=",";
for ($i=0;$i<count($CE);$i++)
{
$ce_txt.=$CE.",";
}

$SQL = "INSERT into maklumat_cidb (no_pendaftaran,gred,bulan,tahun,hari,id_syarikat, kategori_ce) VALUES
('$no_pendaftaran','$gred','$bulan','$tahun','$har i','$id','$ce_txt')";

echo $SQL;

?>

mslh aku skrg dalam database dia tak masuk valur tuk checkbox tp mcm ni ,array,array,
ni kalu aku pilih dua la...

so...tlgla selesaikan mslh aku.....tq
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 20-09-2002, 04:06 PM
New kid on the block
 
Join Date: Jul 2002
Location: Castle of Joyheart, Avonlea
Posts: 8
Rep Power: 0
laparcute is on a distinguished road
try letak camni

$CE=array();
$ce_txt=",";
for ($i=0;$i<count($CE);$i++)
{
$ce_txt.=$CE[$i].",";
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 20-09-2002, 05:26 PM
kasih's Avatar
Novice Webmaster
 
Join Date: Sep 2002
Location: kl
Posts: 27
Rep Power: 0
kasih is on a distinguished road
dah jadik dah...tima kasih...solan yg satu lg x nak tolong jwb ker
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 20-09-2002, 05:29 PM
kasih's Avatar
Novice Webmaster
 
Join Date: Sep 2002
Location: kl
Posts: 27
Rep Power: 0
kasih is on a distinguished road
kalau nak edit camner kiter nak paggil valur 2 balik....coz dia kan banyak2
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 20-09-2002, 05:38 PM
bazet's Avatar
Novice Webmaster
 
Join Date: Aug 2001
Location: Ampang KL
Posts: 93
Rep Power: 90
bazet is on a distinguished road
Send a message via ICQ to bazet Send a message via AIM to bazet Send a message via Yahoo to bazet
  #6 (permalink)  
Old 23-09-2002, 10:19 PM
hymns's Avatar
Senior Webmaster
 
Join Date: Nov 2001
Location: Johor
Posts: 769
Rep Power: 101
hymns is on a distinguished road
Send a message via ICQ to hymns Send a message via Yahoo to hymns
kasih... awak nih kerja buat web cidb ngan pkk ke? tengok coding sama je cam web tu.....
__________________
I hate when:

vBulletin Message:
Sorry! The administrator has specified that users can only post one message every 60 seconds
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 24-09-2002, 09:31 AM
kasih's Avatar
Novice Webmaster
 
Join Date: Sep 2002
Location: kl
Posts: 27
Rep Power: 0
kasih is on a distinguished road
xla...dlm form nie aku kene insertkan hal yg berkaitan dgn pkk dan cidb 2 jer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 24-09-2002, 12:07 PM
hymns's Avatar
Senior Webmaster
 
Join Date: Nov 2001
Location: Johor
Posts: 769
Rep Power: 101
hymns is on a distinguished road
Send a message via ICQ to hymns Send a message via Yahoo to hymns
kira betul la aku cakap kan??? eehhehe
__________________
I hate when:

vBulletin Message:
Sorry! The administrator has specified that users can only post one message every 60 seconds
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
insert php in html sloth Website Programming 7 26-08-2005 07:34 PM
Macam mane nak buat Advanced Preload hani_saidi Website Design 3 04-05-2003 12:53 AM
error jika x masukkan value tuk array kasih Website Programming 16 24-09-2002 10:06 AM
array sorting joyce Website Programming 2 16-06-2002 01:26 AM
cam mane nak detect haribulan masterG Website Design 3 02-04-2002 09:39 AM


All times are GMT +8. The time now is 04:15 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 60 61