ziggy1621
01-24-2008, 03:20 PM
I've got folders that are created through an 'admin' panel on a client's website. When these folders are created, a reference is placed into a database for reference.
I need to write a script that loops through those folders by referencing them in the database and copying files from an 'update' folder so I don't have to manually upload 1 file to all the folders.
I'm not looking for a freebie, so please point me to a tutorial.
I'm guessing something like (gonna be very rough, just trying to get my thought process accross):
$aSQL = "SELECT DISTINCT directory FROM table";
$aQResult = mysql_query( $aSQL, $aDBLink );
if ( $aQResult == true )
{
while ( $aRow = mysql_fetch_array( $aQResult ) )
{
$directory=$aRow['directory'];
///here is where I'm lost.. guessing its gonna be something to the effect of creating an array then using foreach[]?
foreach ($directory as &$copyFolder) {
//long copy function here.. which I already have written
}
Again forgive my messiness.. just can't get my brain wrapped around this one
I need to write a script that loops through those folders by referencing them in the database and copying files from an 'update' folder so I don't have to manually upload 1 file to all the folders.
I'm not looking for a freebie, so please point me to a tutorial.
I'm guessing something like (gonna be very rough, just trying to get my thought process accross):
$aSQL = "SELECT DISTINCT directory FROM table";
$aQResult = mysql_query( $aSQL, $aDBLink );
if ( $aQResult == true )
{
while ( $aRow = mysql_fetch_array( $aQResult ) )
{
$directory=$aRow['directory'];
///here is where I'm lost.. guessing its gonna be something to the effect of creating an array then using foreach[]?
foreach ($directory as &$copyFolder) {
//long copy function here.. which I already have written
}
Again forgive my messiness.. just can't get my brain wrapped around this one