All pastes #166610 Raw Edit

Someone

public text v1 · immutable
·published 2006-09-11 02:19 UTC
rendered paste body
<?php
dbConnect();

$result = @mysql_query("SELECT *,((current_price - start_price)/start_price * 100) AS percent FROM profiles WHERE publish='y' AND public='y' ORDER BY date_published desc");
@mysql_close();

echo "<table border='1' style='font-family: verdana; font-size: 11px; border-style: soild' cellpadding='0' cellspacing='0'>";
echo "<tr> <th style='font-family: verdana; text-align: left;'>Name</th> <th>Symbol</th> <th>Date</th> <th>Profiled Price</th> <th>Price as of 06-08-25</th> <th>Change</th><th>% High Since Profile</th></tr>";

while($row = @mysql_fetch_array( $result )) {

	echo "<tr><td width=15%>";
	echo "<a href='$row[symbol]_profile.php'>" . $row["name"] . "</a>\n"; 
	echo "</td><td width=3%>";
	echo $row['symbol'];
	echo "</td><td width=3%>";
	echo $row['date_published'];
	echo "</td><td width=3% align=right>";
	echo $row['start_price'];
	echo "</td><td width=3% align=right>";
	echo $row['current_price'];
	echo "</td><td width=3% align=right>";
	$font = "<font color=#000000>";
	if($row['percent'] < 0) {
		$font = "<font color=red>";
	}
	if($row['percent'] > 0) {
		$font = "<font color=#008000>+<font color=#008000>";
	}
	echo $font;
	echo number_format($row['percent'] , 1, '.', '');
	echo "%</td>";