Home »
General »
Test Forum »
php script for insert avatars into mysql
php script for insert avatars into mysql [message #7847] |
Tue, 17 December 2002 19:18 |
Anonymous
|
|
|
|
<?
$user = "user";
$password = "password";
$hostname = "localhost_or_IP";
$path = 'images/avatars/';
mysql_connect($hostname, $user, $password)
or die("Unable to connect to SQL server");
$this_id = mysql_insert_id();
$dir_handle = @opendir($path) or die("Unable to open $path");
while($file = readdir($dir_handle)) {
if (substr($file, -3) == 'jpg') {
$result = mysql_db_query("fudforum", "INSERT INTO fud23_avatar (img) VALUES ('$file')");
} }
closedir($dir_handle);
?>
|
|
|
Goto Forum:
Current Time: Sat Nov 30 15:15:37 GMT 2024
Total time taken to generate the page: 0.02150 seconds