Use Jquery hide in a PHP array
<p>I'm trying to use a function to show addition info in my php array. I am echoing tables that show information for my classes and I cannot get the Jquery to work while inside the PHP. I'm not the most experienced in Jquery or PHP so I must be placing it completely wrong. </p>

<p>EDIT: I know my PHP queries are not safe, I have start converting those over eventually.
Here is my code </p>

<pre><code>&lt;link rel="stylesheet" type="text/css" href="css/bigcalendar.css"&gt;

&lt;!DOCTYPE html&gt;
&lt;html&gt;

&lt;head&gt;
    &lt;meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /&gt;

    &lt;title&gt;Webbook | View Schedule&lt;/title&gt;

    &lt;link rel='stylesheet' type='text/css' href='css/style.css' /&gt;

    &lt;!--[if IE]&gt;
      &lt;script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"&gt;&lt;/script&gt;
    &lt;![endif]--&gt;
    &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;
&lt;/script&gt;
    &lt;script type='text/javascript' src='js/jquery.ba-hashchange.min.js'&gt;&lt;/script&gt;
    &lt;script type='text/javascript' src='js/dynamicpage.js'&gt;&lt;/script&gt;
    &lt;script&gt;
$(document).ready(function(){
  $("button").click(function(){
    $("#hidetest").toggle(1000);
  });
});
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;

    &lt;div id="page-wrap"&gt;

        &lt;header&gt;
                 &lt;?php include "navbar.php";?&gt;

        &lt;/header&gt;

        &lt;section id="main-content"&gt;
        &lt;div id="guts"&gt;

          &lt;h2&gt;View Schedule&lt;/h2&gt;

&lt;?php
//get database settings
include("dbinfo.php");

?&gt;



&lt;div align="center"&gt;
&lt;?php
$sqlschedule = mysql_query("SELECT * FROM schedule WHERE student='Austin' ORDER BY `hour`  ASC");
$num_rows = mysql_num_rows($sqlschedule);
//Table starting tag and header cells
while($row = mysql_fetch_array($sqlschedule)){
   //Display the results in different cells
   $hour = $row['hour'];
   $class = $row['class'];
   $teacher = $row['teacher'];
   $classid = $row['classid'];


$sqlclassid = mysql_query("SELECT * FROM classes WHERE classid=$classid");
while($row2 = mysql_fetch_array($sqlclassid)){
$hour2 = $row2['hour'];
$class2 = $row2['class'];
$teacher2 = $row2['teacher'];
}
if($class == ""){
$class = $class2;
}
if($teacher == ""){
$teacher = $teacher2;
}

$sqlhourinfo = mysql_query("SELECT * FROM hours WHERE hour='$hour'");
while($row3 = mysql_fetch_array($sqlhourinfo)){
$starttime = strftime("%l:%M %P", strtotime($row3['starttime']));
$endtime = strftime("%l:%M %P", strtotime($row3['endtime']));
}
/*
$from = mysql_query("SELECT * from members WHERE username='$fromuser'");
$num_rows = mysql_num_rows($from);
//Table starting tag and header cells
while($row = mysql_fetch_array($from)){
   //Display the results in different cells
   $otherid = $row['id'];
   $theusername = $row['username'];
}
*/



echo '&lt;p&gt;This is a paragraph with little content.&lt;/p&gt;
&lt;p style="display:none" id="hidetest"&gt;This is another small paragraph.&lt;/p&gt;
&lt;button&gt;Toggle&lt;/button&gt;
';
   echo '     
&lt;table id="background-image" width="50%" border="0" cellspacing="5" cellpadding="10"&gt;
  &lt;tr&gt;
    &lt;th width="10%" rowspan="2" class="scheduleform" scope="col"&gt;'.$hour.'&lt;/th&gt;
    &lt;td align="left" scope="col"&gt;'.$class.'&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td align="left"&gt;'.$teacher.'&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td colspan="2"&gt;&lt;p&gt;Starts: '.$starttime.'&lt;br&gt;
      Ends: '.$endtime.'
    &lt;/p&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="#" id="opener"&gt;
&lt;img border="0" src="/webbook/images/256.png" alt="Add Assignment" width="32" height="32"&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="#"&gt;
&lt;img border="0" src="/webbook/images/256 (1).png" alt="Edit Assignment" width="32" height="32"&gt;&lt;/a&gt;
&lt;/td&gt;

&lt;/tr&gt;
&lt;/table&gt;







      &lt;/p&gt;

';

}

?&gt;

      &lt;/div&gt;

&lt;/div&gt;
&lt;/div&gt;


        &lt;/div&gt;
        &lt;/section&gt;

    &lt;/div&gt;

    &lt;footer&gt;
      &amp;copy;2013 iHeff Webbook
    &lt;/footer&gt;
    &lt;?php   /* 
include('../footer.php'); 
*/ ?&gt;
&lt;/body&gt;

&lt;/html&gt;
</code></pre>

<p>So I want to achieve is there is a link with an image that says "add assignment". I want to be able to click that and then a hidden form shows up and you can toggle it. Thank you in advance. </p>
