It seems that you forgot to close the double quotes on this line:
WHERE coursename = $coursename;
and you should enclose $coursename in single quotes. So, make it like this:
WHERE coursename = '$coursename'";
Change this:
echo $success_msg;
}
To this:
}
echo $success_msg; // Put outside the else part
That's why your not seeing any success message when it updates fine. Delete this because it's misleading:
echo "Connection success";
Get rid of '@' while testing/debugging this. It suppresses errors.
Maybe you're changing the wrong php.ini and/or you're forgetting to restart you server after every php.ini change. Do a phpinfo(); and it will tell you the path to the php.ini file that PHP is looking at. Make sure you're changing that one.
If all else fails, you can always put this at the top of your script so you can see all of PHP's errors/warnings/notices:
error_reporting(E_ALL);
ini_set('display_errors', '1');
hth.