My view page is breaking on me, the cause is missing double quotes in the php page. I can fix it manually but when I rebuild it breaks again. If any one can help me out it would be much appreciated because this page will be rebuilt several times before I can finally leave it alone (if ever).
Here are the error messages:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in C:\filePath\phprunnerpage_view.php on line 50
Parse error: parse error, unexpected ')' in C:\filePath\phprunnerpage_view.php on line 50
So let's check out that error: (line 50 in bold)
/////////////////////////////////////////////
// FieldX -
$value="";
if(strlen($data["FieldX"]))
{
$strdata = make_db_value("FieldX",$data["FieldX"]);
$LookupSQL="SELECT ";
$LookupSQL.="`FieldX`";
$LookupSQL.=" FROM `Table` WHERE `FieldX` = " . $strdata;
$LookupSQL.=" and (".\"FieldX like 'ARS%'\".")";
LogInfo($LookupSQL);
$rsLookup = db_query($LookupSQL,$conn);
if($lookuprow=db_fetch_numarray($rsLookup))
$value=ProcessLargeText($lookuprow[0],"","",MODE_VIEW);
else
$value=ProcessLargeText(GetData($data,"FieldX", ""),"field=FieldX".$keylink,MODE_VIEW);
}
else
$value="";
$smarty->assign("show_FieldX",$value);
Now If I replace line fifty with: $LookupSQL.=" and ("."\"FieldX like 'ARS%'\"".")";
it all works fine and dandy. However, when rebuilding it will revert to the old problem.
I'm not sure why it wants to do all this fancy SQL Querying for this field in the view (because all other fields just call GetData() ) but I am ASSUMING that it is due to my using a lookup wizard for this field on the Add and Edit pages with the where clause of
"FieldX like 'ARS%'". Which makes the lookup wizard work just fine and dandy.
The only other place I use the WHERE clause is in the sql edit page of PHPRunner. Which is pretty standard and uses the same syntax.
SELECT
--field list
FROM `Table`
WHERE `FieldX` like 'ARS%';
I know this is long, and maybe confusing, but if anyone's got any ideas how I can make this work correctly, even with a rebuild, I would certainly appreciate it a lot.
-Brent