Code: Select all
<?php
$AlreadyThereCheck="select * from Users where SourceId='$Array[0]'";
$AlreadyThere=mysql_query($AlreadyThereCheck);
if ($AlreadyThere){
$AlreadyThereCounter++;
$Update="Update Users SET FirstName='$Array[1]', LastName='$Array[2], MailingAddy=.......where SourceId="$Array[0]'";
$UpdateResult=mysql_query($Update);
}else{
if (!$AlreadyThere){
$Insert="Insert into Users (FirstName, LastName, MailingAddy,.....
VALUES ('$Array[1]', '$Array[2]',,.........'$Array[0]')";
$InsertCounter++;
$InserResult=mysql_query($Update);
}
?>I'm also pretty sure I'm reading from the file correctly.
Any suggestions are appreciated.