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.

    Just spotted something rather strange too. Ive set my error reporting to on etc but when calling phpinfo it says it is set to off?

      I restarted my server and now error_reporting is working which is giving me important debugging info. Curiously enough I made the code changes you guys indictated but have an error on line 55 which is the close php tags!!

      	WHERE coursename = '$coursename'"; 

      $result = mysql_query($sql,$connection);
      echo $result;
      if (mysql_affected_rows() == 1) {
      $success_msg = '<P>The course details have been successfully updated.</P>';
      } else {
      error_log(mysql_error());
      $success_msg = '<P>Something went wrong try again or contact the system administrator.</P>';
      }
      echo $success_msg;
      ?>

        the error is:

        Parse error: parse error in C:\Program Files\Apache Group\Apache2\htdocs\updatecourseformhandler.php on line 55

          the closing bracket for

          if (isset($_POST['Submit'])) { 

          is still missing i guess

            mrhappiness- you have touched pn a good point there. Im a little confused about the use of brackets generally in PHP. Im a newbie ofcourse. Where does the closing bracket go in this case. Also is there any guidelines on syntax generally in terms of bracket usage

              Tezread wrote:

              Where does the closing bracket go in this case.

              After the last line of code that is to be executed if the condition was fulfilled

              Also is there any guidelines on syntax generally in terms of bracket usage

              Yoe need as many closing brackets { as you have opening brackets } 😉
              if that wasn't what you wanted to hear, i didn't get your question right

                Like this?

                if (isset($_POST['Submit'])) {
                //insert the values entered into the courseentry form into the database

                $coursename = $POST['coursename'];
                $accreditingbody = $
                POST['accreditingbody'];
                $briefdesc = $POST['briefdesc'];
                $aimedat = $
                POST['aimedat'];
                $level1 = $POST['level1'];
                $level2 = $
                POST['level2'];
                $level3 = $POST['level3'];
                $elearning = $
                POST['elearning'];
                $facetoface = $POST['facetoface'];
                $blended = $
                POST['blended'];
                $elearningtime = $POST['elearningtime'];
                $facetofacetime = $
                POST['facetofacetime'];
                $blendedtime = $_POST['blendedtime'];

                //update the record
                $sql = "UPDATE trainingtopics SET

                accreditingbody = '$accreditingbody',
                briefdesc = '$briefdesc',
                aimedat = '$aimedat',
                level1 = '$level1',
                level2 = '$level2',
                level3 = '$level3',
                elearning = '$elearning',
                facetoface = '$facetoface',
                blendedlearning = '$blended',
                elearntime = '$elearningtime',
                facetime = '$facetofacetime',
                blendedtime = '$blendedtime'
                WHERE coursename = '$coursename'";
                }
                $result = mysql_query($sql,$connection);

                if (mysql_affected_rows() == 1) {
                echo $success_msg = '<P>The course details have been successfully updated.</P>';
                }
                else echo $success_msg = '<P>Something went wrong try again or contact the system administrator.</P>';
                ?>

                im getting the Something went wrong error- are my brackets in the right place?

                  if (isset($POST['Submit'])) {
                  now there goes some code that is to be executed if $
                  POST['submit'] is set
                  //insert the values entered into the courseentry form into the database

                  $coursename = $POST['coursename'];
                  $accreditingbody = $
                  POST['accreditingbody'];
                  $briefdesc = $POST['briefdesc'];
                  $aimedat = $
                  POST['aimedat'];
                  $level1 = $POST['level1'];
                  $level2 = $
                  POST['level2'];
                  $level3 = $POST['level3'];
                  $elearning = $
                  POST['elearning'];
                  $facetoface = $POST['facetoface'];
                  $blended = $
                  POST['blended'];
                  $elearningtime = $POST['elearningtime'];
                  $facetofacetime = $
                  POST['facetofacetime'];
                  $blendedtime = $_POST['blendedtime'];

                  //update the record
                  $sql = "UPDATE trainingtopics SET

                  accreditingbody = '$accreditingbody',
                  briefdesc = '$briefdesc',
                  aimedat = '$aimedat',
                  level1 = '$level1',
                  level2 = '$level2',
                  level3 = '$level3',
                  elearning = '$elearning',
                  facetoface = '$facetoface',
                  blendedlearning = '$blended',
                  elearntime = '$elearningtime',
                  facetime = '$facetofacetime',
                  blendedtime = '$blendedtime'
                  WHERE coursename = '$coursename'";
                  }
                  now there goes some code that is to be executed always
                  $result = mysql_query($sql,$connection);

                  if (mysql_affected_rows() == 1) {
                  echo $success_msg = '<P>The course details have been successfully updated.</P>';
                  }
                  else echo $success_msg = '<P>Something went wrong try again or contact the system administrator.</P>';
                  ?>

                  I colored the brackets that belong together

                  Try

                  if (isset($POST['Submit'])) {
                  now there goes some code that is to be executed if $
                  POST['submit'] is set
                  //insert the values entered into the courseentry form into the database

                  $coursename = $POST['coursename'];
                  $accreditingbody = $
                  POST['accreditingbody'];
                  $briefdesc = $POST['briefdesc'];
                  $aimedat = $
                  POST['aimedat'];
                  $level1 = $POST['level1'];
                  $level2 = $
                  POST['level2'];
                  $level3 = $POST['level3'];
                  $elearning = $
                  POST['elearning'];
                  $facetoface = $POST['facetoface'];
                  $blended = $
                  POST['blended'];
                  $elearningtime = $POST['elearningtime'];
                  $facetofacetime = $
                  POST['facetofacetime'];
                  $blendedtime = $_POST['blendedtime'];

                  //update the record
                  $sql = "UPDATE trainingtopics SET

                  accreditingbody = '$accreditingbody',
                  briefdesc = '$briefdesc',
                  aimedat = '$aimedat',
                  level1 = '$level1',
                  level2 = '$level2',
                  level3 = '$level3',
                  elearning = '$elearning',
                  facetoface = '$facetoface',
                  blendedlearning = '$blended',
                  elearntime = '$elearningtime',
                  facetime = '$facetofacetime',
                  blendedtime = '$blendedtime'
                  WHERE coursename = '$coursename'";

                  $result = mysql_query($sql,$connection);

                  if (mysql_affected_rows() == 1) {
                  echo $success_msg = '<P>The course details have been successfully updated.</P>';
                  }
                  else echo $success_msg = '<P>Something went wrong try again or contact the system administrator.</P>';
                  }
                  now there goes some code that is to be executed always
                  ?>

                    Good stuff. I understand that now. I have other error messages now!!

                    Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: NO) in C:\Program Files\Apache Group\Apache2\htdocs\updatecourseformhandler.php on line 7
                    Couldn't connect to server

                    I took off the @ symbols on mysql_connect/mysql_select_db and changed the variable $root ti $user in my connection as well as putting in my password which results in:

                    Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Program Files\Apache Group\Apache2\htdocs\updatecourseformhandler.php on line 7
                    Couldn't connect to server.

                      Tezread wrote:

                      Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Program Files\Apache Group\Apache2\htdocs\updatecourseformhandler.php on line 7
                      Couldn't connect to server.

                      http://dev.mysql.com/doc/mysql/en/old-client.html

                        Thx Mr Happiness for yuor patience. Done that- followed the first set of instructions:
                        mysql> SET PASSWORD FOR
                        -> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

                        and had a query of 0 rows affected;

                        result now:
                        Something went wrong try again or contact the system administrator

                          Tezread wrote:

                          result now:
                          Something went wrong try again or contact the system administrator

                          seems like connecting to the database is working now as this is a message you generate

                          do output $sql vie echo and change

                          $result = mysql_query($sql,$connection); 

                          to

                          $result = mysql_query($sql,$connection) or die(mysql_error().'<hr />'.$sql.'<hr />'); 

                            i get a parse error if I try that

                              either your php is broken or you're doing something wrong

                              show the relevant code

                              btw: please use those marvelous

                               [/php&#93; tags

                                [<?php
                                error_reporting(E_ALL);
                                ini_set('display_errors', '1');
                                $user = "root";
                                $host = "localhost";
                                $password = "westhamunited2k5";
                                $connection = mysql_connect($host, $user, $password)
                                or die ("Couldn't connect to server.");
                                $database = "courses";
                                $db = mysql_select_db($database, $connection)
                                or die ("Couldn't select database.");

                                if (isset($POST['Submit'])) {
                                //now there goes some code that is to be executed if $
                                POST['submit'] is set
                                //insert the values entered into the courseentry form into the database

                                $coursename = $POST['coursename'];
                                $accreditingbody = $
                                POST['accreditingbody'];
                                $briefdesc = $POST['briefdesc'];
                                $aimedat = $
                                POST['aimedat'];
                                $level1 = $POST['level1'];
                                $level2 = $
                                POST['level2'];
                                $level3 = $POST['level3'];
                                $elearning = $
                                POST['elearning'];
                                $facetoface = $POST['facetoface'];
                                $blended = $
                                POST['blended'];
                                $elearningtime = $POST['elearningtime'];
                                $facetofacetime = $
                                POST['facetofacetime'];
                                $blendedtime = $_POST['blendedtime'];

                                //update the record
                                $sql = "UPDATE trainingtopics SET
                                accreditingbody = '$accreditingbody',
                                briefdesc = '$briefdesc',
                                aimedat = '$aimedat',
                                level1 = '$level1',
                                level2 = '$level2',
                                level3 = '$level3',
                                elearning = '$elearning',
                                facetoface = '$facetoface',
                                blendedlearning = '$blended',
                                elearntime = '$elearningtime',
                                facetime = '$facetofacetime',
                                blendedtime = '$blendedtime'
                                WHERE coursename = '$coursename'";
                                }
                                //now there goes some code that is to be executed always
                                result = mysql_query($sql,$connection) or die(mysql_error().'<hr />'.$sql.'<hr />');

                                if (mysql_affected_rows() == 1) {
                                echo $success_msg = '<P>The course details have been successfully updated.</P>';
                                }
                                else echo $success_msg = '<P>Something went wrong try again or contact the system administrator.</P>';
                                ?>]

                                  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                                  "http://www.w3.org/TR/html4/loose.dtd">
                                  <html>
                                  <head>
                                  <title>Course entry form</title>
                                  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
                                  <script language="JavaScript" type="text/JavaScript">
                                  <!--
                                  function MM_reloadPage(init) { //reloads the window if Nav4 resized
                                  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
                                  document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
                                  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
                                  }
                                  MM_reloadPage(true);
                                  //-->
                                  </script>
                                  </head>

                                  <body>
                                  <div id="Layer1" style="position:absolute; width:497px; height:115px; z-index:1; left: 236px; top: 21px;">
                                  <form name="courseentryform" method="post" action="updatecourseformhandler.php">

                                  <div align="left">

                                  <select name="coursename">

                                  <?php
                                  $user = "root";
                                  $host = "localhost";
                                  $password = "";
                                  $connection = mysql_connect($host, $root, $password) or die ("Couldn't connect to server.");
                                  $database = "courses";
                                  $db = mysql_select_db($database) or die ("Couldn't select database.");

                                  $sql = "SELECT coursename FROM trainingtopics";

                                  $result = mysql_query($sql) or die(mysql_error());
                                  echo $result."=result<br>";

                                  while($row=mysql_fetch_array($result))
                                  {
                                  echo "<option value='".$row['coursecode']."'>".$row['coursename']."</option>\n";
                                  }
                                  ?>
                                  </select>
                                  <br>
                                  <br>
                                  <input type='text' name='accreditingbody'>
                                  <br>
                                  <br>
                                  <textarea name="briefdesc" cols="75" id="briefdesc"></textarea>
                                  <br>
                                  <br>
                                  <textarea name="aimedat" cols="75" id="aimedat"></textarea>
                                  <br>
                                  <br>
                                  <select name="level1" size="1" id="level1">
                                  <option>Yes</option>
                                  <option>No</option>
                                  <option>Not selected</option>
                                  </select>
                                  <br>
                                  <br>
                                  <select name="level2" size="1" id="level2">
                                  <option>Yes</option>
                                  <option>No</option>
                                  <option>Not selected</option>
                                  </select>
                                  <br>
                                  <br>
                                  <select name="level3" size="1" id="select2">
                                  <option>Yes</option>
                                  <option>No</option>
                                  <option>Not selected</option>
                                  </select>
                                  <br>
                                  <br>
                                  <select name="elearning" size="1" id="select3">
                                  <option>Yes</option>
                                  <option>No</option>
                                  <option>Not selected</option>
                                  </select>
                                  <br>
                                  <br>
                                  <select name="facetoface" size="1" id="select4">
                                  <option>Yes</option>
                                  <option>No</option>
                                  <option>Not selected</option>
                                  </select>
                                  <br>
                                  <br>
                                  <select name="blended" size="1" id="select5">
                                  <option>Yes</option>
                                  <option>No</option>
                                  <option>Not selected</option>
                                  </select>
                                  <br>
                                  <br>
                                  <input name="elearningtime" type="text" id="elearningtime" value="" size="50">
                                  <br>
                                  <br>
                                  <input name="facetofacetime" type="text" id="facetofacetime" value="" size="50">
                                  <br>
                                  <br>
                                  <input name="blendedtime" type="text" id="elearningtime" value="" size="50">
                                  <br>
                                  <br>
                                  <input type="submit" name="Submit" value="Submit">

                                  <input type="reset" name="reset" value="Reset">
                                  </form>
                                  <br>
                                  <br>
                                  <br>
                                  <br>
                                  <br>
                                  </div>
                                  </form>
                                  <div id="Layer2" style="position:absolute; width:200px; height:19px; z-index:2; left: 29px; top: 24px;">Choose a course name </div>
                                  <div id="Layer3" style="position:absolute; width:200px; height:20px; z-index:3; left: 28px; top: 64px;">Accrediting body </div>
                                  <div id="Layer4" style="position:absolute; width:200px; height:23px; z-index:4; left: 28px; top: 105px;">Brief description </div>
                                  <div id="Layer5" style="position:absolute; width:200px; height:21px; z-index:5; left: 26px; top: 193px;">Aimed at </div>
                                  <div id="Layer6" style="position:absolute; width:200px; height:20px; z-index:6; left: 28px; top: 284px;">Level 1? </div>
                                  <div id="Layer7" style="position:absolute; width:200px; height:20px; z-index:7; left: 26px; top: 325px;">Level 2?</div>
                                  <div id="Layer8" style="position:absolute; width:200px; height:18px; z-index:8; left: 26px; top: 370px;">Level 3?
                                  <div id="Layer9" style="position:absolute; width:200px; height:20px; z-index:9; left: -2px; top: 44px;">E Learning? </div>
                                  <div id="Layer10" style="position:absolute; width:200px; height:22px; z-index:10; left: -2px; top: 85px;">Face to face? </div>
                                  <div id="Layer11" style="position:absolute; width:200px; height:20px; z-index:11; left: -3px; top: 129px;">Blended?</div>
                                  <div id="Layer12" style="position:absolute; width:200px; height:20px; z-index:12; left: -4px; top: 171px;">E learning time </div>
                                  <div id="Layer13" style="position:absolute; width:200px; height:21px; z-index:13; left: -4px; top: 212px;">Face to face time </div>
                                  <div id="Layer14" style="position:absolute; width:198px; height:21px; z-index:14; left: -4px; top: 252px;">Blended time</div>
                                  </div>
                                  </body>
                                  </html>

                                    you have to write

                                     insert your php code here [/php&#93;
                                    
                                    and why for heaven's sake don't you try to fix the parse error by yourself?
                                    it's kind of obvious
                                    
                                    hint: you failed doing copy&paste properly