2017-08-22 This is some real-world (prototype) code: function XYoci_parseCursor($conn,$sql) { $stmt =$conn->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL)); $stmt->execute(); $arr = $stmt->errorInfo(); if ($arr[0]=="00000") return $stmt; echo "
";
print_r($arr);
die();
}
Can you see the program flow?
There's a lot done bad in this code. One of the problems can be
prevented by the simple rule: Always use braces for blocks!
There's no single good reason why one should omit them, thus
there's no need to compromise (which is unusual, because usually
we programmers have to take disadvantages regarding one goal in
order to achieve another). Just write those braces, every time!
So simple.
http://marmaro.de/lue/ markus schnalke