Im interested to know. If 'display errors' is set to on in php.ini and you have echo statements strategically placed in code as well as having the 'or die' function why is it stil possible to click submit in a form and get a blank page with no errors or echoed statements. Is this a common thing? Is there something im missing?

    either there are no errors (beside logical ones 😉) or your setting of [man]error_reporting[/man] is inappropriate

      mrhappiness is right, use

      <?php error_reporting(E_ALL); ?>

      and then you will get an output, or something is very wrong in which case you can set log_errors to 1 and error_log to a file which will contain the errors.
      Another way of debugging is taking some of the code out and narrowing where the error is.
      You could also show us the code...

        I have posted my code already in another thread so I dont want to wind anyone up!
        In my php.ini file ive set the following to true

        error_reporting = e_all

        display_errors = on

        this indicates all errors should be reported surely but still nothing gives

          Hey Im having the same problem in my thread (its titled "This is weird...")

            Tezread wrote:

            this indicates all errors should be reported surely but still nothing gives

            so where from do you know that there are errors?

              In short- i do not know where there are errors from. Ive had many top programmers from this site scrutinize my code and they can't see any problems. Im regularly getting blank pages when I create forms that have two sides to them 1. a form 2. a form handler. Ive tried combining the two and having a self submission form but then I don't get the results i want. I was advised that debugging is the key to finding errors. Ive tried this with echo statements and my_sql error functions but to no avail. Im going to show you the code im using at the moment to see if my debugging methods are correct: Note the variable $user is declared as $root when trying a connection to the db. Strange thing is this works when im inserting data and when I change it it doens't.
              I know this comes across as a double post guys but im trying to see if I have problems with debugging which is a different subject to my previous threads regarding this code. Note their are NO error messages at all and I have changed my php.ini settings to show all errors (error_reporting = E_ALL & ~E_NOTICE ) and display_errors = on

              <?php

              echo "open db and php commence";
              $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, $connection)
              or die ("Couldn't select database.");
              echo "db open";
              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);
              echo "Connection success";
              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;
              }
              echo $result;
              ?>

                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 />');