Hello,
I am going nuts looking for the cause of:
Parse error: syntax error, unexpected T_VARIABLE in /home/dev/www/filter.php on line 104
<?php
// Counts record in table
$query_s = "SELECT COUNT(*) FROM irs_rawdata";
$result_s = mysql_query($query_s) OR die("Sorry, unable to count the records in the table!");
$result_c = mysql_result($result_s, 0);
echo ".$result_c.";
// checks to see if sesult_c is greater then zero
// if so then it runs script
// otherwise it says there is no more records to process
for($i=0; $i<$result_c; $i++)
{
// selects Col EIN from table and gives one result back with only the EIN col
$query_s = "SELECT EIN FROM irs_rawdata LIMIT 0,1";
// $result_s = mysql_query($query_s) OR die("Sorry, unable to select record for: ! <br /> ". mysql_error())";
$result_s = mysql_query($query_s) OR die("Sorry was unable to insert into the database table allowed! <br />" . mysql_error());
// changes long var to short var
$fin = $result_s['EIN'];
// gets record if there is one in block
$query_s = "SELECT fin FROM block WHERE fin=$fin";
$result_s = mysql_query($query_s) OR die("Sorry, unable to select record for: " . mysql_error());
$records = mysql_numrows($result_s) OR die("Was unable to get number of rows");
// if there is no record in block runs script
// if there is 1 record then it runs the else script
if ($result_s==0)
{
// gets record if there is one in allow
$query_s = "SELECT fin FROM allow WHERE fin=$fin";
$result_s = mysql_query($query_s) OR die("Sorry, unable to select record for: ".$xx." ! <br />" . mysql_error());
$records = mysql_numrows($result_s) OR die("Was unable to get number of rows");
// see if there is no record
//if no record runs script
if ($result_s==0)
{
// selects all fields where fin match,
// if after filting there a match it
// then insert into the irs_query table
// then deletes from old table irs_rawdata
$query_is = "INSERT INTO irs_query SELECT * FROM irs_rawdata WHERE (fin = '$fin' AND PNO LIKE '%blind%' OR PNO LIKE '%deaf%' OR PNO LIKE '%ear%' OR PNO LIKE '%eye%' OR PNO LIKE '%sight%' OR PNO LIKE '%wheelchair%' OR PNO LIKE '%dog%' OR PNO LIKE '%disab%' OR NTEE_Code LIKE '%g41%' OR NTEE_Code LIKE '%g41%')";
$result_is = mysql_query($query_is) OR die("Sorry was unable to insert and select the records from the db table irs_rawdata! <br />" . mysql_error());
$query_d = "DELETE FROM irs_rawdata WHERE EIN='$fin'";
$result_d = mysql_query($query_d) OR die("Was unable delete ".$fin." from the db table irs_rawdata! <br />" . mysql_error());
$records = mysql_numrows($result_s) OR die("Was unable to get number of rows");
if($records ==0)
{
$query_i = "INSERT INTO block (fin, who_blocked) VALUES ('$fin', 'p-131498798')";
$result_i = mysql_query($query_i) OR die("Was unable insert ".fin." into the database!" . mysql_error());
$query_d = "DELETE FROM irs_rawdata WHERE EIN='$fin'";
$result_d = mysql_query($query_d) OR die("Was unable delete ".$fin." from the db table irs_rawdata! <br />" . mysql_error());
}
}
else
{
include '/home/dev/www/l_to_s_var.php';
$query_s = "SELECT * FROM irs_rawdata WHERE fin = '$fin'";
$result_s = mysql_query($query_s) OR die("Sorry, unable to count the records in the table!");
include '/home/dev/www/l_to_s_var.php';
$query_u = "UPDATE irs_query
SET
EIN = '$fin'
PNO = '$pno'
ICN = '$icn'
Street_Address = '$sa'
City = '$a_city_c'
State = '$a_state_c'
Postal_Code = '$a_postal_c'
GEN = '$gen'
Subsection_Code = '$sc'
Affiliation_Code = '$ac'
Classification_Code = '$cc'
Ruling_Date = '$rd'
Deductibility_Code = '$dc'
Foundation_Code = '$fc'
Activity_Code = '$a_c'
Organization_Code = '$oc'
UL_Code = '$ulc'
AFED = '$afed'
Tax_Period = '$tp'
Asset_Code = '$asset_c'
Income_Code = '$income_c'
FR_Code = '$frc'
Blanks = '$b'
Accounting_Period = '$ap'
Asset_Amount = '$asset_a'
Income_Amount = '$income_a'
IAN_NS = '$ian_ns'
F_990_RA = '$f990_ra'
RAN_N = 'S$ran_ns'
NTEE_Code = '$ntee'
SN_SNL = '$sn'
WHERE (fin = '$fin')"
$result_u = mysql_query($query_u) OR die("Sorry was unable to insert and select the records from the db table irs_rawdata! <br />" . mysql_error());
$query_d = "DELETE FROM irs_rawdata WHERE EIN='$fin'";
$result_d = mysql_query($query_d) OR die("Was unable delete ".$fin." from the db table irs_rawdata! <br />" . mysql_error());
}
}
else
{
$query_d = "DELETE FROM irs_rawdata WHERE EIN='$fin'";
$result_d = mysql_query($query_d) OR die("Was unable delete ".$fin." from the db table irs_rawdata! <br />" . mysql_error());
}
}
else
{
echo "there is no more records to process!";
}
?>
thanks for any help in this matter!
Sincerely,
Christopher
MOD EDIT: File removed - no need to have both (besides, the PHP syntax highlighting looks nicer 😉).