Looping through an image directory
<p>I need to loop through a .png image directory and insert the file name in a mysql database.</p>

<p>This is what I have so far:</p>

<pre><code>mysql_connect('localhost', 'admin', '');
mysql_select_db('database');

// Each file is formated like this
$file = 'Abe+Froman+SK_HG.png';

$player_name = urldecode(str_replace("_HG.png", "", $file));
//echo $player_name;

mysql_query("INSERT IGNORE INTO signatures SET gamertag = '".$player_name."'");
</code></pre>
