Jump to content

Recommended Posts

Hey guys

If i have a database like this

3753d1366377739-untitled-1.jpg

 

How can I extract items so that after each item is extracted sub​​-items

So the output will be

 

		<ul>
			<li>
				<span>Item 1</span>
			</li>
			<li>
				<span>Item 2</span>
				<ul>
					<li>
						<span>Item 2-1</span>
						<ul>
							<li>
								<span>Item 2-1-1</span>
							</li>
							<li>
								<span>Item 2-1-2</span>
							</li>
						</ul>
					</li>
					<li>
						<span>Item 2-2</span>
						<ul>
							<li>
								<span>Item 2-2-1</span>
								<ul>
									<li>
										<span>Item 2-2-1-1</span>
									</li>
									<li>
										<span>Item 2-2-1-2</span>
									</li>
								</ul>
							</li>
						</ul>
					</li>
				</ul>
			</li>
			<li>
				<span>Item 3</span>
				<ul>
					<li>
						<span>Item 3-1</span>
						<ul>
							<li>
								<span>Item 3-1-1</span>
							</li>
						</ul>
					</li>
					<li>
						<span>Item 3-2</span>
					</li>
					<li>
						<span>Item 3-3</span>
					</li>
				</ul>
			</li>
		</ul>
 
Please answer and thank you :)

Can you reattach the photo of your database? The basic idea is to query the database, loop through the results and echo out the query results inside out the loop along with the HTML you want to output.

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.