Hi,

I am trying to do some multiple inserts using the following code but it 
doesn`t seem to work, it inserts the first one but then the second is 
inserted as blank. Where the value being passed is

$Emails="[EMAIL PROTECTED], [EMAIL PROTECTED]";

<?
// Get Login info

require("blah...");

// Connect to MySQL

$connection=mysql_connect($host, $user, $pass);

// Format the Emails

$Emails1=str_replace(" ","",$Emails);
$GetEmails=explode(",",$Emails1);

// Insert into Members Database

for ($a=0;$a<count($GetEmails);$a++){ 
$SQLStatement = "INSERT INTO Members (Email) VALUES ('".$GetEmails[$a] ."')" 
or die ("Problem");
$db = mysql_select_db($dbase, $connection);
$SQLResult = mysql_query($SQLStatement);

}

?>

Anyone know what might be going wrong, or perhaps I have the wrong method?

Thanks
Ade

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to