CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 [SOLVED]Parse error: syntax error, unexpected T_STRING

Print topic Send  topic

Author Message
frankthefixer

Posts: 52
Posted: 06/17/2010, 11:33 AM

I'm adding a new page to a project that's already up and running. It's is a record page where the first field that data is entered into (serial#) must validate for a match against serial#'s in another table (same connection/db, but not a table involved with the record form). Once it finds a match it should grab an id (RecID) from that matching serial record and put it into the RecID field on this new record form. Serials are unique records in both tables. I wasn't too sure on how to proceed with this but what I did was use the DLookup action in the Validate event for the serial textbox.

Expression: SELECT RecID
Domain: FROM RcvSerial
WHERE Serial = '{Serial}'
Conn: Connection1
Convrt to: Text
Type of Target: Control
Target: RecID

not sure if my FROM should read more like FROM Connection1.RcvSerial, but in any event when i upload the page and try it i get:
Parse error: syntax error, unexpected T_STRING in /home2/mysite/public_html/project/MixedAudit_events.php on line 23

and line 23 in the events page is:
$ccs_result = CCDLookUp(SELECT RecID, FROM RcvSerial, WHERE Serial = '{Serial}', $Page->Connections["Connection1"]);

I've searched the forum and found some similar problems, but not specifically like this. Is the syntax of my sql bad maybe? I have been uploading and editing other pages within this project and have'nt had this error until this form and my first attempt at using Validate.
Any help is greatly appreciated.

CCS Personal Ed, 3.2.0.6 -
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 06/17/2010, 4:09 PM

frankthefixer
Try this link it will point you to information that will help you: http://www.google.com/search?hl=en&q=ccdlookup+php+site...l=&oq=&gs_rfai=
View profile  Send private message
frankthefixer

Posts: 52
Posted: 06/17/2010, 4:50 PM

thanks mamboBROWN, was just actually going to edit this post- found a link in a brasilian codecharge forum, which after translation was able to discern i needed quotes around each sql part- got past the error like this:

Expression: "SELECT RecID"
Domain: "FROM RcvSerial"
WHERE "Serial = '{Serial}'"
Conn: Connection1
Convrt to: Text
Type of Target: Control
Target: RecID

i have other problems i'm trying to get past like why it's not posting the RecID to the RecID form field, or why on <enter> in the serial field is it trying to submit the form instead of going to the next textbox- but am past the T_String error using those doublequotes.
Thanks again
View profile  Send private message
frankthefixer

Posts: 52
Posted: 06/20/2010, 1:02 PM

..i'm still really stuck on this. i can't figure out why it's not posting the sql result to the control. I tried the dlookup action in 'on validate' directly on the serial textbox and later at the form validate. neither way worked. I checked the sql and it works fine by itself as a query and returns the correct RecID. I also tried the sql with both SELECT and SELECT DISTINCT (even though a match will always be a unique since serial is a unique field in both tables). maybe i should rename this topic "on validate dlookup"- or just mark it SOLVED and start a new topic for dlookup.

global $DBConnection1;
$Page = CCGetParentPage($sender);
$ccs_result = CCDLookUp("SELECT DISTINCT RcvSerial.RecID AS RcvSerial_RecID", "FROM RcvSerial", "WHERE Serial = '{Serial}'", $Page->Connections["Connection1"]);
$ccs_result = intval($ccs_result);
$Container->RecID->SetValue($ccs_result);
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.