Hi,
I'm using a PHP snippet from the SMF forums, which allows me to import 300 users into our private forum.
During the import process, I need to determine who doesn't have an email address (Column is blank in the Member CSV that i'm importing from)
If the field is blank, I need to substitute a fake email address, which will be the Member Number i.e.
[email protected]The Import PHP file uses an array to grab the data from the CSV, then parses it to SUB-MEMBERS.PHP to load the SQL database i.e
'email-address' => $key[0],
'member-number' => $key[1],
So, I need something like this to work in my Import PHP file: (Sorry, it's in BASIC)
IF $key[0] = "" THEN
// No email address, so make one up, using Member Number
'email-address' => $key[1] & "no-email.com"
ELSE
// Email address exists, so use it
'email-address' => $key[0]
END IF
Thanks again.
Thanks for your help, Shambles.
I had to change a few things to make it work, but all good.
'email' => empty($key[3]) ? $key[0] . "@no-email.com" : $key[3],
Thanks very much.