Jump to content

[SOLVED] Using file() on a file within a folder


Bricktop

Recommended Posts

Hi all,

 

I have s cript which reads in an SQL file and then restores it to the database.  It works like:

 

$filename = 'test.sql';

mysql_connect, select blah blah

$lines = file($filename);

foreach($lines as $line)
{
do restore here
}

 

However, my $filename variable will be things like "backups/bigdatabase/backup.sql" or backups/someotherdb/backup.sql".  I have no problem passing the filename variable to the above function but the file() function only seems to open filenames, not filenames containing the oflder structure.

 

What can I do to pass a full path to the file() function?

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.