Created
February 21, 2018 12:53
-
-
Save CDRO/d4b1863486864ff3366b1fbdded1b6d5 to your computer and use it in GitHub Desktop.
TYPO3 check if fe_users have valid images
This file contains 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 | |
/** | |
* Either execute the script on the shell or directly in the browser. | |
* Place the script in the webroot and call it. | |
*/ | |
if(php_sapi_name() !== 'cli') { | |
echo '<pre>'; | |
} | |
echo 'Connecting', PHP_EOL; | |
$m = new mysqli('localhost', 'name', '***', 'db'); | |
$query = 'SELECT image FROM fe_users WHERE image IS NOT NULL'; | |
echo 'Selecting:', PHP_EOL, $query, PHP_EOL; | |
$r = $m->query($query); | |
echo $m->error; | |
while($row = $r->fetch_assoc()) { | |
echo 'File: ', $row['image'], (file_exists('uploads/pics/' . $row['image']) ? '' : ' does not'), ' exist', PHP_EOL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment