CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 dlookup criteria where setting="name"

Print topic Send  topic

Author Message
it--solutions


Posts: 24
Posted: 08/28/2009, 4:45 PM

Yet another frustrating codecharge feature that does not work out of the box, if anyone could be kind enough to shed some light on this.

The MySQL statement below works fine manually executed:
SELECT value FROM common_settings WHERE setting='swap_year'
returns the value: 2009

i'm trying to include this result as the value in a hidden field within my form

here is the dlookup panel which i've added to the BeforeShow Event of the hidden field



the error is in the "CRITERIA" section (WHERE STATEMENT)
as the apache log file spits this out: PHP Parse error: syntax error, unexpected '=' in /file.php


I have read other forums wanting to use where THIS = the session id, product code from a form, I just want

WHERE THIS = 'TEXT'
ie.
WHERE setting='swap_year'

Simple, nothing too difficult i would have thought?
Thanks in advance
View profile  Send private message
datadoit
Posted: 08/28/2009, 5:45 PM

Double click on that Dlookup. It'll take you to the code that CCS
created.

Your problem will be in the single quote. You may need to escape it
first. (\')
datadoit
Posted: 08/28/2009, 5:48 PM

I must enlighten folks on the power and flexibility of CCS, and this is
one of those areas... If the Dlookup statement is written correctly,
then when the application is swapped from PHP to another language such
as ASP, ZERO code rewrite will be required in situations such as this.

There is so much that can be accomplished in CCS with little or no
custom coding - the trick is finding the where and when.
it--solutions


Posts: 24
Posted: 08/28/2009, 6:36 PM

Thanks for your quick response.

below is the code:

//DLookup @102-5222C97D
global $DBclubman;
$Page = CCGetParentPage($sender);
$ccs_result = CCDLookUp(value, common_settings, setting=\'swap_year\', $Page->Connections["clubman"]);
$ccs_result = strval($ccs_result);
$Container->year->SetValue($ccs_result);
//End DLookup


Have re-published the files, still getting this error

PHP Parse error: syntax error, unexpected '=' on line 38 which is
$ccs_result = CCDLookUp(value, common_settings, setting=\'swap_year\',


?so strange
View profile  Send private message
damian

Posts: 838
Posted: 08/29/2009, 12:12 AM

i believe that you might have your syntax wrong... here is an example...

i want to do the following query:
select my_email from my_table where my_id=id (from url)

expression: my_email
domain: my_table
criteria: "my_id=".CCGetParam("id","")
connection: myconnection (as defined in your connection properties)
convert result to: Text
type of target: Control
target: my_label

so i think you have incorrectly used the quotes in criteria....

hth
damian


_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
damian

Posts: 838
Posted: 08/29/2009, 12:16 AM

also - where/what is swap_year? is it a value stored in a session, url, field etc?
you need to tell the dlookup where/how to get this value? eg i used CCGetParam to grab it from the url....

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
it--solutions


Posts: 24
Posted: 08/29/2009, 1:45 AM

I'm building an event management system, primarily for swap meets, not sure if they are called that oversees, maybe car boot sale?

anyway theres 1800 individual sites and site holders at an annual Automotive Swap Meet.
the code on the other forum

http://forums.codecharge.com/posts.php?post_id=107735

worked just fine

"setting='swap_year'"

..its wasn't an issue of code logic, just syntax (Dots, Dashes & Inverted Commas)
Thanks everyone for your help
:-)
View profile  Send private message
damian

Posts: 838
Posted: 08/29/2009, 3:10 AM

please post your answer.... others may benefit from it.
_________________
if you found this post useful take the time to help someone else.... :)
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.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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