FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » Test Forum » php script for insert avatars into mysql
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
php script for insert avatars into mysql [message #7847] Tue, 17 December 2002 19:18
Anonymous   Austria

is that cool ?[ 0 votes ]
1.
2.
3.
4.
 

<?
$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);
?>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Muster
Next Topic: test topic
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 11:52:15 GMT 2024

Total time taken to generate the page: 0.02615 seconds