All pastes #521947 Raw Edit

Unnamed

public text v1 · immutable
#521947 ·published 2007-05-30 09:38 UTC
rendered paste body
require_once ('mysql_connect.php');
		$query = "select * from users, tutorials WHERE users.username = tutorials.username and
		valid = 'Valid'";
		$result = @mysql_query ($query);
                $num_rows = mysql_num_rows($result);
		
		echo "<br><table 
			width=\"950\"
			border=\"1\"
			cellpadding=\"3\" 
			bgcolor=\"#99ccff\" 
			align=\"center\">";
		
		echo "<th bgcolor=\"#ffffff\">Username</th>
			<th bgcolor=\"#ffffff\">Lesson</th>
			<th bgcolor=\"#ffffff\">Example Code</th>
			<th bgcolor=\"#ffffff\">Browser View</th></tr>";
	        if($num_rows == 0)
{
//Display Error
}
else
{

		while($ROW = mysql_fetch_array($result))
		{	
			$ec = htmlspecialchars($ROW[exampleCode]);
				
			echo "<td> $ROW[username] </td>";
			echo "<td> $ROW[lesson] </td>";
			echo "<td> $ec </td>";
			echo "<td> $ROW[browserCode] </td></tr>";
		
		}
}
		echo "</table>";