My script is simple
$storagelocation = exo_getglobalvariable(‘HEPubStorageLocation’, ‘’);
$dbname = $storagelocation.‘data.sqlite’;
$dbh = new PDO(‘sqlite:’.$dbname);
$sql=“SELECT * FROM payments WHERE player=1 and flag = 0”;
$data=$dbh->query($sql);
foreach ($data as $row)
{ echo $row’pay’];
}
but get this error popup when i run the application
PHP Warning: Invalid argument supplied for foreach() in …
I think it is the connection with the database… I tried all kind of ways to fix it. I changed location of database lots of times, inside or outside the application folder.I used a db file and a sqlite and I’ ve read the sqlite connection demo but still cant seem to fix this… Any help is appreciated.
$storagelocation = exo_getglobalvariable(‘HEPubStorageLocation’, ‘’);
$dbname = $storagelocation.‘data.sqlite’;
$dbh = new PDO(‘sqlite:’.$dbname);
$sql=“SELECT * FROM payments WHERE player=1 and flag = 0”;
$data=$dbh->query($sql);
foreach ($data as $row)
{ echo $row’pay’];
}
but get this error popup when i run the application
PHP Warning: Invalid argument supplied for foreach() in …
I think it is the connection with the database… I tried all kind of ways to fix it. I changed location of database lots of times, inside or outside the application folder.I used a db file and a sqlite and I’ ve read the sqlite connection demo but still cant seem to fix this… Any help is appreciated.
Last edited: