append strings...
Posted: Sun Oct 29, 2006 10:40 pm
Hey Guys, All I want to do here is append this string as it loops through and print out the following values
echo $sUserAdded;
echo $sTaxIDExists;
echo $sUsernameExists;
I know it gets in the loop, because I can print out the SQL statements...what simpleton thing am I doing wrong here... Thanks
echo $sUserAdded;
echo $sTaxIDExists;
echo $sUsernameExists;
I know it gets in the loop, because I can print out the SQL statements...what simpleton thing am I doing wrong here... Thanks
Code: Select all
case "officials":
{
echo 'Here we will do lookup by both tax_id and email. If either exists, we will skip the record, if not we will insert';
echo '</br></br>';
$user = new Employee();
foreach ($_POST['chk'] as $name => $val)
{
$title = $_POST['title_' . $val];
$fname = $_POST['fname_' . $val];
$mname = $_POST['mname_' . $val];
$lname = $_POST['lname_' . $val];
$tax_id = $_POST['taxid_' . $val];
$username = $_POST['username_' . $val];
$password = $_POST['password_' . $val];
$suffix = $_POST['suffix_' . $val];
if(isset($tax_id))
{
$sqlstrGetByTaxID = <<< SQL
SELECT
id
FROM
users.employees
WHERE
tax_id = '$tax_id'
SQL;
$sqlstrGetByUsername = <<< SQL
SELECT
id
FROM
users.employees
WHERE
username = '$username'
SQL;
if($db->query($sqlstrGetByTaxID))
{
while($row = $db->fetch())
{
$sTaxIDExists .= 'User Tax ID' . '-' . $tax_id . '</br>';
}
}
elseif($db->query($sqlstrGetByUsername))
{
while($row = $db->fetch())
{
$sUsernameExists .= 'Username Exists' . '-' . $username . '</br>';
}
}
else
{
$sUserAdded .= 'User Added' . '-' . $tax_id . '</br>';
}
echo $sUserAdded;
echo $sTaxIDExists;
echo $sUsernameExists;
}
}
break;
}