Page 1 of 1

php not executing

Posted: Tue Feb 06, 2007 6:46 pm
by psychotomus
my php code wont execute or even show any of the html.

it works on the rest of the site http://www.sundaybrew.com
it wont show any on http://www.sundaybrew.com/linklist.php

any ideas/

Code: Select all

<table width="100%"  border="0">
	  <tr>
		<td><div align="center">Site</div></td>
		<td><div align="center">Hits In</div></td>
		<td><div align="center">Hits Out</div></td>
	  </tr>
<?php

include("dbsetts.php")
$conn=mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname) or die ("Unable to connect to MySQL");

$result = mysql_query( "SELECT * FROM sites ORDER BY hits_in DESC" ) or die("SELECT Error: ".mysql_error());

while($row=mysql_fetch_array($result) )
{
	print '
	  <tr>
		<td><div align="center"><a href="' . $row['site_url'] . '">' . $row['site_title'] . '</a></div></td>
		<td><div align="center">' . $row['hits_in'] . '</div></td>
		<td><div align="center">' . $row['hits_out'] . '</div></td>
	  </tr>';

}

?>
</table>

Posted: Tue Feb 06, 2007 8:53 pm
by feyd
You have a parse error.

Posted: Tue Feb 06, 2007 9:09 pm
by wildwobby
error_reporting('E_ALL');

??

Posted: Tue Feb 06, 2007 11:19 pm
by RobertGonzalez
You're missing a semicolon after your include. If you are developing locally, you could always turn error reporting on so you can see where the error is.

Posted: Wed Feb 07, 2007 3:56 am
by Ollie Saunders
wildwobby wrote:error_reporting('E_ALL');
Lose the quotes around the E_ALL and add an

Code: Select all

ini_set('display_errors', true);
and your there!

Posted: Wed Feb 07, 2007 10:30 am
by RobertGonzalez
Keep in mind that turning on display_errors using ini_set() would still not have shown this parse error.