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

 modifying {SQL_Where}

Print topic Send  topic

Author Message
THX1138

Posts: 37
Posted: 01/15/2009, 11:05 PM

Hi all,

Im using dependent listboxes and need to modify the where clause of the sql select
that populates the dependent listbox.
Can anyone point me at where the {SQL_Where} thing in the ccs code gets generated
so that i can add extra clauses to it ?
Been searching through the page php code and page_events.php code and cant see
where it is being assembled.

TIA,
t

excerpt of code::

$DataSource->SQL = "SELECT * \n" .
"FROM anp_plan INNER JOIN anp_asstplan ON\n" .
"anp_plan.PLAN_id = anp_asstplan.plnid {SQL_Where} {SQL_OrderBy}";







View profile  Send private message
mentecky

Posts: 321
Posted: 01/15/2009, 11:52 PM

THX1138,

Click your listbox. Select "Before Build Select" in events and add custom code. Then you need something like:
   $where = $Component->ds->Where;    
    
   // If the where clause isn't empty add "AND" to it    
   if (strlen($where))    
   {    
      $where.= " AND ";    
   }    
    
   // Add your additions to the WHERE clause here  
   $where .= "x=y";    
           
   $Component->ds->Where = $where;    

Hope that helps,

Rick
_________________
http://www.ccselite.com
View profile  Send private message
THX1138

Posts: 37
Posted: 01/16/2009, 1:08 AM

Thanks Rick,
Ive found the sections you referred to, but my thinking is a bit fuzzy atm,
so i'll try it more methodically in the (my) morning. Thanks for your reply, it's given me places to look i hadnt thought of,
cheers,
THX
View profile  Send private message
damian
Posted: 01/16/2009, 4:29 PM

i wonder if this post had illegal chaaracters added to its subject when you
marked it solved?
or it could be another glitch altogether such as ocurred earlier in the week?

---------------------------------------
Sent from YesSoftware forum
http://forums.yessoftware.com/
THX1138
Posted: 01/16/2009, 4:45 PM

in the initial post i had the <!-- // -left cury brace S Q L - w h e r
e
which got replaced with the post number seen in the new post heading
when i tried to edit it to be solved.

i think i may have stumbled over an sql injection by mistake , although i
didnt see the earlier glitch this week


---------------------------------------
Sent from YesSoftware forum
http://forums.codecharge.com/
jjrjr1


Posts: 942
Posted: 01/18/2009, 7:00 AM

Hi

Actually Thanks for having inadvertently stumbled on this.

This could have been a big problem for all of us. At least it can be fixed.

Bet you were supprised....:-O

Have fun

_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
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.