Jump to content

[SOLVED] getting a variable to display another variable, possible?


frobak

Recommended Posts

is it possible?

 

i want to use a variable to display another variable thats populated by a mysql query?

 

so far what happens is that it just prints the variable in the html page, and doesnt treat it as a variable.

 

I am displaying the contect dynamically.

 

basically $dl_count value is $dl_count_show1

 

it prints $dl_count_show1 in the html, but it should display the value of the variable, which is the result of a mysql query counting instances of a database row.

 

hope ive explained that ok

 

heres the code:

			$query="SELECT * FROM pbzarchive ORDER BY date_added";
			$result=mysql_query($query);

			$num=mysql_numrows($result);

			mysql_close();

			$i=0;
			while ($i < $num) {

			$mix_title = mysql_result($result,$i,'mix_title');
			$djname = mysql_result($result,$i,"djname");
			$mix_length = mysql_result($result,$i,"mix_length");
			$mix_size = mysql_result($result,$i,"mix_size");
			$filename = mysql_result($result,$i,"filename");
			$dl_count = mysql_result($result,$i,"dl_count");

			echo "<div class='mix'>
					<table id='mix'>
					<th colspan='2'>$mix_title
					</th>
					<tr>
						<td id='mix'>DJ's : 
						</td>
						<td id='mix'>$djname
						</td>
					</tr>
					<tr>
						<td id='mix'>Mix length : 
						</td>
						<td id='mix'>$mix_length
						</td>
					</tr>
					<tr>
						<td id='mix'>Mix size : 
						</td>
						<td id='mix'>$mix_size
						</td>
					</tr>
					<tr>
						<td id='mix'><A href='../downloads/$filename.php' onClick='popup = window.open('downloads/$filename.php', 'PopupPage', 'height=135,width=265,scrollbars=no,resizable=no'); return false' target='_blank'>Download</a>

						</td>
						<td id='mix'>";
			print $dl_count;
			echo "
						</td>
					</tr>
				</table>
			</div>";
			$i++;
			}
			?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.