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
|
|
|
|
is that cool ?[ 0 votes ] |
1. |
yes |
0 / 0% |
2. |
no |
0 / 0% |
3. |
equal |
0 / 0% |
4. |
who matters |
0 / 0% |
<?
$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: Mon Dec 23 02:20:36 GMT 2024
Total time taken to generate the page: 0.04410 seconds