if have a piece of code that is to hard for me to solve.. And i don't know how i can find the error more than this.
                while($this->_pathLus != $this->hoofdMap) { //loop works fine, tested and confirmd
                echo $this->_pathLus . 0; //$this->_pathLus = <data4>
                if ($stmtToegang = $db->prepare("SELECT <data>, <data2> FROM `<data3>` WHERE <data> = ? LIMIT 5")) {
                    $stmtToegang->bind_param("s",$this->_pathLus);
                    $stmtToegang->execute();
                    $stmtToegang->bind_result($<data>, $<data2>);
                    while ($stmtToegang->fetch()) {
                        echo $<data> . 1;
                        echo $stmtToegang->error . 2;
                    }
                } else { //to be sure if-stmt-prep is FALSE
                    echo $stmtToegang->error . 3;
                }
                $this->_pathLus = preg_replace("/(.*)\/(.*)\/(.*)\//", "$1/$2/", $this->_pathLus); // part of Loop and works
            }
What i did to find solution:
- check if $stmtToegang is correct everywhere
- check if the sql-select is correct
- Check if _pathLus is correct
- add else on if-stmt-prep to make sure is failed
Results:
- <data4>03<data4>03<data4>03<data4>03<data4>03
- <data4>03<data4>03<data4>03
- <data4>03<data4>03<data4>03<data4>03
- <data4>03<data4>03
- <data4>03
- <data4>03<data4>03
Note: <data>, <data2>, <data3> are replacements for this example
Thanks in advance
Edit: Correction
Edit:
mysqli_prepare() returns a statement object or FALSE if an error occurred.
But how get the error that Happens ?
