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

 Where does one go in CodeCharge Studio to build their own SQL query?

Print topic Send  topic

Author Message
DWade
Posted: 02/20/2004, 7:48 AM

I am using PHP and MySQL. I have a table called "PunchClock" with the following fields:
logName
logTime
inOut

I want to use the following query string to setup the search screen:

SELECT logName,DATE_FORMAT(logTime,'%m,%d,%Y') AS fmt_logDate,DATE_FORMAT(logTime,'%r') AS fmt_logTime,inOut

but I can't find any place to put it. I tried opening the SQL window but all I get is the "pictures" of the tables. I clicked on the sql button and saw what was being used, but when I tried to make my own changes it wouldn't let me.

I'm sorry I'm not use to dealing with pictures. Am I just slam out of luck or am I missing something here?

Thanks for any help;

Dennis
peterr


Posts: 5971
Posted: 02/20/2004, 12:43 PM

There are at least couple ways to do this:
1. After you build your Grid using the Grid Builder, open the "Data Source" property, then change "Table" to "SQL" and enter your own SQL query. Do not click the "Build Query" button that displays the tables.
Also see: http://docs.codecharge.com/studio/html/UserGuide/Forms/FormDataSource.html

2. Use Events to alter the generated SQL:
http://docs.codecharge.com/studio/html/Components/RTProperties/PHP/SQL.html
http://docs.codecharge.com/studio/html/ProgrammingTechn.../ModifySQL.html

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
DWade
Posted: 02/23/2004, 3:26 AM

Thank you for your response Peter. I found and downloaded the User Guide, and it has proven helpful on some points, but I still can't figure out how to write my code so that CodeCharge will process it. I know that it is simply a matter of my not knowing how to work with this program yet.

I was handed the 30 day version and told to look at it and see if it would be a help to me. I am use to writing my own apps and doing things my way. So far I can see that if I don't want to do anyting other than create forms and grids to read , write, and search tables this is a great program but as to how I can customize anything I'm at a complete loose.

I tried taking a simple project like having a hidden field called "fullname" and then concatinating "lname", "fname", "initial" to it after populating the fields in a form. I can't seem to get CodeCharge to recognize my code.

I'm sure it's a matter of getting to know how to use the program but I'm not finding anything in the Users Guide to help me understand it. Where can I learn how and where to put custome code so that CodeCharge and I can work together, rather than being at odds with each other? Right now I'm finding this a very frustrating experience.

Thank you for any help;

Dennis
Michael Mikkelsen
Posted: 02/25/2004, 9:33 AM

Let me give you some place to start.

Let's say you have a grid called Grid1
You have created a hidden field called fullname.

You access these fields useing their objects like this.

Add this to the custom code to a before show event

$fname = Grid1->fname->GetValue();
$lname = Grid1->lname->GetValue();

Grid1->fullname->SetValue( $fname . " " . $lname );

That should give you some idea of how you work with the data that CCS pulls out of the database for you.
DWade
Posted: 02/26/2004, 7:05 AM

Quote Michael Mikkelsen:
Let me give you some place to start.

Let's say you have a grid called Grid1
You have created a hidden field called fullname.

You access these fields useing their objects like this.

Add this to the custom code to a before show event

$fname = Grid1->fname->GetValue();
$lname = Grid1->lname->GetValue();

Grid1->fullname->SetValue( $fname . " " . $lname );

That should give you some idea of how you work with the data that CCS pulls out of the database for you.


Thanks Michael,

What I'm seeing is that CCS is totally object oriented. I have been avoiding OO, but it seems that if I want to use CCS I better start learning OO PHP. H-u-m-m-m not real thrilled with that prospect.

I do appreciate your kind assistance.

Dennis

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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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