Thanks anyone that can help, what am I doing wrong?
Code: Select all
<?php
$ftp_server = "x.x.x.x";
$ftp_user = "hello";
$ftp_pass = "world";
// set up a connection or die
$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
// try to login
if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
//successful connection
echo "Connected as $ftp_user@$ftp_server\n";
//failed connection here
$connection = new pdo("sqlite:ftp://x.x.x.x/path/path/path/database.sqlite3");
$query="SELECT * FROM table";
$result = $connection->query($query);
foreach($result as $entry){
echo $entry['name'];
}
} else {
echo "Couldn't connect as $ftp_user\n";
}
// close the connection
ftp_close($conn_id);
?>