Jump to content

Recommended Posts

This code gives me a table which stores a parent skill and its children skills

in a row. like this

 

Net                  PHP          joomla                MVC

.Net 1.0              PHP3.5        joomla1              MVC1.5

.Net 2.1                                joomla2              MVC2.0

.Net 3.0

 

 

This is just one row of table.

This code would create as many columns as there are number of major skills but i want the major skill coming after MVC should automatically go in next row. Basically i don't want more than four columns.

How can put this condition in code?

 

 

 

<table align = "center" border = "1" cellspacing = "10">

	<tr>
	<?php
	while($row = mysql_fetch_array($result))
	{
		$skill_id = $row['skill_id'];

		 $result2 = mysql_query("SELECT * FROM skills where skill_id = $skill_id && parent = 'm'");  
			while ($row2 = mysql_fetch_array($result2))
				{
					$result1 = mysql_query("SELECT * FROM skills where parent = $skill_id"); 

	?>

	<td>
	     <a href="#" class="menu1" "><b><?php echo $row2['skill'] ?></a><br> 



            <div id="123" >
	<?php	
while ($row1 = mysql_fetch_array($result1)){ ?>
       <a href="#" class="submenu"><?php echo $row1['skill'] ?> </a>
   <?php } ?>
             </div>

    </td>
	<?php  } } ?>


	</tr>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.