Html tournament table with php

Hi all,

I’ve eventually figured out how to draw up an html tournament bracket however only one issue remains is i have this html code which you can see below only issue is Where you see Players 1 vs Player 2 and 3 VS 4 and So on only thing i want all these information coming from database.

so im not sure how to approach this kind of thing maybe have 6 to 7 different functions getting each player but its going to be hard so not sure what would be the best way to go about it.

<div class="tournament8-wrap">
		<div class="round4-top winner4">Winner</div>
		<div class="round3-topwrap">
			<div class="round3-top">Top finalist</div>
			<div class="round2-topwrap">
				<div class="round2-top">1-8 winner</div>
				<div class="round1-top">Player 1</div>
				<div class="round1-bottom">Player 2</div>
			</div>
			<div class="round2-bottomwrap">
				<div class="round2-bottom">Round 2 Bottom Winner</div>
				<div class="round1-top">Player 3</div>
				<div class="round1-bottom">Player 4</div>
			</div>
		</div>
		<div class="round3-bottomwrap">
			<div class="round3-bottom">Round 3 Bottom finalist</div>
			<div class="round2-topwrap">
				<div class="round2-top">2-7 winner</div>
				<div class="round1-top">Player 3</div>
				<div class="round1-bottom"Player 6</div>
			</div>
			<div class="round2-bottomwrap">
				<div class="round2-bottom">Round 2 bottom Winner</div>
				<div class="round1-top">Player 7</div>
				<div class="round1-bottom">Player 8</div>
			</div>
		</div>
	</div>

i was thinking of using an array but then i’d have to have seperate strings for each user them selfs so it would be abit difficuilt.

if anyone can help it would be good.

Having done this very same thing myself, I can only suggest that you are wasting your time using html. Use PHP and populate everything from a db. In fact, only generate a pdf as output since you cannot print an html bracket reliably.