PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
psychotomus
Forum Contributor
Posts: 487 Joined: Fri Jul 11, 2003 1:59 am
Post
by psychotomus » Tue Feb 06, 2007 6:46 pm
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>
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Feb 06, 2007 8:53 pm
You have a parse error.
wildwobby
Forum Commoner
Posts: 66 Joined: Sat Jul 01, 2006 8:35 pm
Post
by wildwobby » Tue Feb 06, 2007 9:09 pm
error_reporting('E_ALL');
??
RobertGonzalez
Site Administrator
Posts: 14293 Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA
Post
by RobertGonzalez » Tue Feb 06, 2007 11:19 pm
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.
Ollie Saunders
DevNet Master
Posts: 3179 Joined: Tue May 24, 2005 6:01 pm
Location: UK
Post
by Ollie Saunders » Wed Feb 07, 2007 3:56 am
wildwobby wrote: error_reporting('E_ALL');
Lose the quotes around the E_ALL and add an
and your there!
RobertGonzalez
Site Administrator
Posts: 14293 Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA
Post
by RobertGonzalez » Wed Feb 07, 2007 10:30 am
Keep in mind that turning on display_errors using
ini_set() would still not have shown this parse error.