Last active
December 29, 2015 15:59
-
-
Save stefanheimes/7694188 to your computer and use it in GitHub Desktop.
Replace filepath with dbfas id
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$objResult = Database::getInstance()->prepare('SELECT * FROM XXXX') ->execute(); | |
while($objResult->next()) | |
{ | |
$objTlFiles = Database::getInstance() | |
->prepare('SELECT * FROM tl_files WHERE path=?') | |
->execute($objResult->image); | |
if($objTlFiles->numRows == 0) | |
{ | |
continue; | |
} | |
Database::getInstance() | |
->prepare('UPDATE XXXX SET image=? WHERE id=?') | |
->execute($objTlFiles->id, $objResult->id); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment