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

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-03-2007, 02:44 PM
annuR's Avatar
Novice Webmaster
 
Join Date: Sep 2005
Location: Perak
Posts: 13
Rep Power: 0
annuR is on a distinguished road
Send a message via Yahoo to annuR
nk ty pasal database..

salam...
actually saya ada buat fill a select box from database(mysql database).so niee cth codes dia..

include 'dbase.php';

$query = "SELECT * FROM project ";
$result = mysql_db_query($dbname,$query);

if(mysql_num_rows($result)) {
print("<option value=\"\">Please Choose..</option>");
while($row = mysql_fetch_array($result)) {
$project_name = $row["project_name"];
print("<option value=\"$project_name\">$project_name</option>");
}
} else {
print("<option value=\"\">No users created yet</option>");
}
</script>
</select>
</font></div>

cth, dlm select box tu akan papar mklmat yg ada dlm database spt senarai2 nama projek. So katakan user pilih, salah satu dr senarai nama projek tersebut bgmn kita nk kuarkan maklumat2 yg hy berkaitan dgn nama project tue je.
Actually saya dh try edit guna search punya coding tp x berjy..So ada idea lain x?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-03-2007, 03:08 PM
yipguseng's Avatar
Lost Webmaster
 
Join Date: Jan 2007
Location: Petaling Jaya
Posts: 857
Rep Power: 42
yipguseng will become famous soon enough yipguseng will become famous soon enough
Send a message via MSN to yipguseng
dun really quite understand what and where and how u wanna display after u click..
__________________
Boonage - Freedom is Everything
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-03-2007, 04:38 PM
mysticmind's Avatar
Super Moderator
 
Join Date: Jun 2001
Location: Mystic Kingdoms
Posts: 2,680
Rep Power: 145
mysticmind will become famous soon enough mysticmind will become famous soon enough
Send a message via Yahoo to mysticmind
maaf, soalan anda gagal difahami.
sila jelaskan dengan lebih baik.

(*aku baca sampai 5 6 kali nak faham apa yang anda mahu, tapi still gagal. )
__________________
Personal's Blog! - Malaysian Artist!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-03-2007, 05:00 PM
iamfreelancer's Avatar
Vibrate your Brain Please
 
Join Date: Sep 2005
Location: in my body lar...
Posts: 1,249
Rep Power: 65
iamfreelancer will become famous soon enough iamfreelancer will become famous soon enough
susah susah... i sudah sesat dengan soalan mu....
boh jelaskan lebih klear lagi ar.....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-03-2007, 05:34 PM
robot's Avatar
Senior Webmaster
 
Join Date: Jul 2006
Location: My
Posts: 969
Rep Power: 48
robot will become famous soon enough
aku dah baca kat 10X pun tak brp paham?
aku nak tau, braper table yg ko pakai dan mklmat yg berkaitan dgn nama project tu ko simpan dlm table maner? project juga?
tolong jelaskan apa fungsi yg ko nak capai ngan code nie
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-03-2007, 06:45 PM
mazudi's Avatar
Novice Webmaster
 
Join Date: Feb 2007
Location: Sabah
Posts: 47
Rep Power: 0
mazudi is on a distinguished road
Kalau tak silap pemahaman aku, bila orang klik kat select box tu, dia akan pergi ke detail page according to clicked item tu.

Aku pun novice lagi ni, dan aku biasa pakai Dreamweaver.

Try letak id kat link ke detail page kau. Contohnya:
detailpage.php?id=1 dan seterusnya untuk setiap item. Pakai query pun boleh ni.

Lepas tu, kat detail page tu, MySQL query kena ada $_GET['ID'] supaya bila dia submit id=1 maka dia akan baca row yg item id = 1 dan lepas tu kau boleh echo semua detail berdasarkan item id tu.

Paham ke tak ni. Aku pun boleh terkonfius bila nak explain benda ni. Harap akan ada senior senior lain yg boleh tolong.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 06-03-2007, 09:19 AM
annuR's Avatar
Novice Webmaster
 
Join Date: Sep 2005
Location: Perak
Posts: 13
Rep Power: 0
annuR is on a distinguished road
Send a message via Yahoo to annuR
maap mbuatkan semua org tak paham pada soalan..actually penerangan saya yg kurang jelas..erm..apa yg saya nk mcm yg mazudi bg tau bila orang klik kat select box tu, dia akan pergi ke detail page according to clicked item tu.

thanks bg respon..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 14-03-2007, 11:49 AM
webek's Avatar
Novice Webmaster
 
Join Date: Aug 2004
Location: Kuching, Sarawak
Posts: 27
Rep Power: 0
webek is on a distinguished road
Apa yg aku faham.

Database ada data array, then a script akan ambik data dari array tersebut dan display sebagai dropdown option. Apabila user select an option, extra info untuk option tersebut akan didisplay, seperti combo option. Kalau aku, aku guna php untuk get data array dr external file, set sebagai dropdown option dan guna javascript untuk combo option, cara ni lebih pantas.


Sample php:
-------------------------------------
<?
$lines = file('data.txt');
foreach ($lines as $line)
{
echo "<option value=".$line.">".$line."</option>";
}
?>
__________________
http|//www.jelajahborneo.uni.cc
Semuanya Bermula Di Sini!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 15-03-2007, 11:04 AM
bushak's Avatar
Novice Webmaster
 
Join Date: May 2003
Location: Isketambola Street
Posts: 17
Rep Power: 0
bushak is on a distinguished road
Send a message via Yahoo to bushak
Quote:
Originally Posted by annuR View Post
maap mbuatkan semua org tak paham pada soalan..actually penerangan saya yg kurang jelas..erm..apa yg saya nk mcm yg mazudi bg tau bila orang klik kat select box tu, dia akan pergi ke detail page according to clicked item tu.

thanks bg respon..
ada javascript utk dropdown option cam nie... Antaranya:
+ Chained Selects
+ Drop down menu w/ description - http://www.dynamicdrive.com/dynamici...bodescribe.htm
__________________
http://jsm.hukm.ukm.my
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 16-03-2007, 09:10 AM
annuR's Avatar
Novice Webmaster
 
Join Date: Sep 2005
Location: Perak
Posts: 13
Rep Power: 0
annuR is on a distinguished road
Send a message via Yahoo to annuR
thanks kpd semua yg memberi respon..
anyway, saya dh dapat dh...
terima kasih yea semua...
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
Pasal PHP....[LOGO] cybersix Website Programming 4 14-03-2007 12:04 PM
pasal proxy.. just Website Programming 1 18-12-2005 11:21 PM
nak tanya pasal checkbox... mas83 Website Programming 12 30-01-2004 10:23 AM
Nak Belajar Pasal PHP Cyber-Boy Website Programming 2 22-09-2002 03:31 AM
Tanya skit pasal Kod PHP ? Muslim Website Programming 8 22-09-2002 02:15 AM



All times are GMT +8. The time now is 05:45 PM. 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