it seems that lines 12-13 have this code (i'm referring to those lines because the warning says the problem is in line 13).
$result=mysql_query($query);
while($row=mysql_fetch_array($result,MYSQL_ASSOC))
the warning also says that parameter 1 ($result) is boolean, which probably means that $result is false here. you can check this using var_dump($result). if that is so, it means that you have an error in your query execution.
in general, it's a good idea to check if $result has a value before fetching the data:
$result=mysql_query($query);
if($result) {
// result is ok, fetching the data
while($row=mysql_fetch_array($result,MYSQL_ASSOC))
...
}
else {
// some error occurred
}