CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Can't add PHP function to SQL statement

Print topic Send  topic

Author Message
Brent
Posted: 05/05/2002, 1:04 AM

In CC2 it was quite easy to add a PHP function when constructing the
SQL statement by concatenating it into the string. But now for some
reason if I include a " in the Data Source SQL statement, CCS will
double quote it.

Here is an example:
SQL Statement in dialog:

select * from table where rcd_date >= ".GetDateFcn({s_search_date})

Output code:

select * from table where rcd_date >= "".GetDateFcn(" .
$this->wp->GetDBValue("1")

So you see after the >= it adds two double quotes which does not end
the current string. If I wanted two double quotes, I would have added
them myself or used \" to insert a quite into the string.

How can I fix this? TIA

Brent
RonB
Posted: 05/05/2002, 3:19 AM


"Brent" <bdgridly@mailbolt.com> schreef in bericht
news:a6p9ducm6sd70p5f74995k223celv42rvs@4ax.com...

> Here is an example:
> SQL Statement in dialog:
>
> select * from table where rcd_date >= ".GetDateFcn({s_search_date})
>
> Output code:
>
> select * from table where rcd_date >= "".GetDateFcn(" .
> $this->wp->GetDBValue("1")
>
> How can I fix this? TIA
>
> Brent

I think the problem is a missing " at the beginning of your select
statement?
It should be:
"select * from table where rcd_date >= ".GetDateFcn({s_search_date});
Maybe during generation syntax is checked and CCS adds a " because php is
expecting it?
CCS might think your trying to use an empty string in your php thus changes
" into ""

Ron

Brent
Posted: 05/05/2002, 10:00 AM

"RonB" <r.borkent@123chello.nl> wrote:

:
:"Brent" <bdgridly@mailbolt.com> schreef in bericht
:news:a6p9ducm6sd70p5f74995k223celv42rvs@4ax.com...
:
:> Here is an example:
:> SQL Statement in dialog:
:>
:> select * from table where rcd_date >= ".GetDateFcn({s_search_date})
:>
:> Output code:
:>
:> select * from table where rcd_date >= "".GetDateFcn(" .
:> $this->wp->GetDBValue("1")
:>
:> How can I fix this? TIA
:>
:> Brent
:
:I think the problem is a missing " at the beginning of your select
:statement?
:It should be:
:"select * from table where rcd_date >= ".GetDateFcn({s_search_date});
:Maybe during generation syntax is checked and CCS adds a " because php is
:expecting it?
:CCS might think your trying to use an empty string in your php thus changes
:" into ""
:
:Ron
:

Ron,
Unfortunately it doesn't work that way. CCS/CC will automatically
put the " at the beginning and end of the SQL string, that's why I
left it off. If I put a " at the beginning of the string, the
generated code gets:

$this->SQL = """SELECT * .....

so it ends up with triple quotes. :(

CCS will double any quote it finds so if I add a " anywhere in the SQL
string, CCS produces "" and of course that doesn't help me one bit.
This is totally different than in CC where it didn't double quote
anything.

Does anyone know how to use the Data Source Type: PROCEDURE when
constructing the SQL statement? Maybe I can build the SQL statement in
code. For example, how do I create the Stored Procedure name? (MySQL
doesn't have stored procedures so I'm hoping they're talking about a
CCS PHP procedure PHP.)

Brent

   


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.