PHP error " Undefined variable: mysql_fetch_assoc" : <p>I'm recieving the above error when I try to run this code, I have tried multiple solutions, using fetch_array too:
    

<pre><code>$conn = mysql_connect('localhost', '-----', '-----','-----') 
or die('Error connecting to mysql');
$sql = "SELECT * FROM Subject";
$result = mysql_query($sql);
$row=null;
echo "&lt;table&gt;";
while( $row = $mysql_fetch_assoc[$result]){

echo "&lt;tr&gt;&lt;td&gt;";
echo $data['SubjectNo'];
echo "&lt;/td&gt;&lt;td&gt;";
echo $data['SubjectName'];
echo"&lt;/td&gt;&lt;/tr&gt;";
} 
echo "&lt;/table";
echo"urnan";

?&gt;
</code></pre>
