Dear All,

I'm going to put some submenus into tabs and put its contents there. i want to fetch the name of the tab (menu) from the database. for this case, i must use looping 'while'.

for example

$query=mysql_query("SELECT * FROM modul WHERE ket='submenu_mahasiswa'");
<div id="tabs">
<?php while($result){ ?>
		<li><a href="#tabs-1">$result['nama_modul']</a></li>
	<?php } ?>

	<div id="tabs-1">Content 1 Here! (I can put anything here, form etc..)

The problem --> id of each tab must be different based on the menu link(<a href="#tabs-1">). how can i make that since i use looping and fetching data from database???

Hope i make my question clear..thank you :)

You sure have a unique id field in the modul table which you could use to form an anchor, like in <a href="#tabs-$result['id']">$result['nama_modul']</a> Apart from that, the php code tags are missing in line 9.

Thanks for the reply smantscheff,ya the id is unique
i'll try that..but, what about the tab content itself? guess, i must type the div id of tab manually so when the tab hit, the content is there.

Why can't you generate the tab content from the database?

No, i think i can generate the content. i'll try for more..

Thanks a lot smantscheff. that's a lot of help :))

Please mark this thread as solved - if it is.