Recently I've switched to using SQLite databases and a problem that keeps presenting itself is the database resource set at the top of a page not being available in
foreach or
for loops.
Example:
$dbloc = "c:\web\db\test.sqlite";if($db = sqlite_open("$dbloc", 0666, $sqlite_error)){}else{die ($sqlite_error);}
for($i=0; $i<8; $i++){
echo $db;
}
In that example $db outputs nothing, instead of "Resource #". Adding "global $db;" to the loop does nothing.