Thanks for the help ... made some progress but get the following in the Error Log Browser:
(/home/eunivers/FUDforum/include/theme/default/db.inc:72
/home/eunivers/FUDforum/include/theme/default/db.inc:176
/home/eunivers/FUDforum/scripts/fudapi.inc.php:676
/home/eunivers/FUDforum/scripts/addusercvs.php:15
) 1054: Unknown column 'e' in 'field list'
Query: INSERT INTO fud26_users ( login, alias, passwd, name, email, icq, aim, yahoo, msnm, jabber, affero, posts_ppg, time_zone, bday, last_visit, conf_key, user_image, join_date, location, theme, occupation, interests, referer_id, last_read, sig, home_page, bio, users_opt, reg_ip ) VALUES ( 'e', 'e', 'e', 'e', 'e', 0, 'e', 'e', 'e', 'e', 'e', 0, 'e', 0, 0, 'e', 'e', e, 'e', 0, 'e', 'e', 0, 0, 'e', 'e', 'e', 0, -1 )
Server Version: 4.0.25-standard
Here's my script ...
<?php
include_once("/home/eunivers/FUDforum/include/GLOBALS.php");
include ("fudapi.inc.php");
$filename = "/home/eunivers/bin/testusers.txt";
$fh = fopen ($filename, "r") or die("Could not open file");
while (!feof($fh))
{
$fields = fgetcsv($fh, 20);
$err = 0;
$vals = array();
$vals['login'] = $fields[0];
$vals['passwd'] = $fields[1];
$vals['email'] = $fields[2];
$vals['name'] = $fields[3];
$usid = fud_add_user($vals, &$err);
fclose ($fh);
?>
Here's my CSV data file ...
user1,password1,email1(at)noplace(dot)com,name1
user2,password2,email2(at)noplace(dot)com,name2
user3,password3,email3(at)noplace(dot)com,name3
user4,password4,email4(at)noplace(dot)com,name4
user5,password5,email5(at)noplace(dot)com,name5
[Updated on: Fri, 01 December 2006 14:33] Report message to a moderator
|