Hi guys,
I've written a simple script to get items from a MySQL database and put them within the Spry Accordion widget supplied with Dreamweaver, but when I try to open the file the screen just comes up blank. Here is the code, saved in my site directory as index.php:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Rolling Snowballs</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
<link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="bannertop"><br />
<img src="images/title.png" width=219 height=35 alt="logo"/>
</div>
<div class="navbg">
<div id="navcontainer">
<ul id="navlist">
<li><a href=index2.html>Home</a></li>
<li><a href="about.htm">About</a></li>
<li><a href="news.htm">News</a></li>
<li><a href="productions.htm">Productions</a></li>
<li><a href="press.htm">Press</a> </li><li><a href="contact.htm">Contact</a></li>
</ul>
</div>
</div>
<div class="flashcontent">
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','800','height','150','title','browser','src','images/browser','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','images/browser' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="800" height="150" title="browser">
<param name="movie" value="images/browser.swf" />
<param name="quality" value="high" />
<embed src="images/browser.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="800" height="150"></embed>
</object></noscript>
</div>
<div class="content">
<div class="leftcolumn">
<div class="leftcolumnheader">Recent News
</div>
<div id="Accordion1" class="Accordion" tabindex="0">
<?php
//connect to the server
$connection = mysql_connect('localhost', 'guest','guest')
or die ('Unable to connect to MySQL server');
// select database
mysql_select_db('rollsnow') or die ('Unable to connect to Database!');
$query = 'SELECT date, title, info FROM news ORDER BY date DESC LIMIT 0 , 3;';
$result = mysql__query($query)
or die ('Error in query: $query. ' . mysql_error());
if (mysql_num_rows($result) > 0 {
while($row = mysql_fetch_row($result)
{
echo '<div class="AccordionPanel">';
echo '<div class="AccordionPanelTab">' . $row['date'] . ' - ' . $row['title'] . '</div>';
echo '<div class="AccordionPanelContent">' $row['info'] . '</div></div>';
}
else
{
//print error message
echo 'No Rows Found!';
}
// free result set
mysql_free_result($result);
// close connection
mysql_close($connection);
?>
</div>
</div>
<div class="rightcolumn">
<div class="videobox">
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','337','height','252','src','images/deathvdeath','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','images/deathvdeath' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="337" height="252">
<param name="movie" value="images/deathvdeath.swf" />
<param name="quality" value="high" />
<embed src="images/deathvdeath.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="337" height="252"></embed>
</object>
</noscript>
</P>
</div>
</div>
</div>
</div>
<script type="text/javascript">
<!--
var Accordion1 = new Spry.Widget.Accordion("Accordion1");
//-->
</script>
</body>
</html>
Anybody have any ideas why this is?
Thanks
Edd