wiz561
|
| Posted: 05/12/2005, 10:53 AM |
|
Hi!
I'm just getting started with the demo version of codecharge and I'm finding it rather confusing. It works great when you want to create a simple web page with a connection to a mysql database. I know this is probably really simple to do, but I'm hitting a wall when I try to do what I have to... Here's what's going on...
I have two tables. Table 'a' has a primary key that's autogenerated called "snum". There are other rows in this table that store information such as company names and such. Table 'b' has the 'snum' row in it as well that is a relationship to table a's snum row. This table has detailed information about the companies. Table a can only have one company, where as in table b, there could be numerous employees assigned to the one company.
I believe there's a web site in the KB that sort of describes this, but it's rather confusing. I need to make a web site that will add, search, and update the information in the database. I was thinking of doing something that displays the company name, and you can click on it and it brings you to another page that has all the employees you can add or update. However, I just don't know how to make that link that relates table a to b.
Any information is appreciated!
Thanks!
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 05/12/2005, 12:55 PM |
|
1. You need to create a link that passes the company id from your grid to the 2nd page.
Once the company id is shown in the URL of the 2nd page then:
2. You need to use that URL parameter in your grid's SQL query or table.
That's it.
Regarding #1, you can open the "Href Source" property of the link and then click the [+] to add your company id to the URL.
Sample demos of #2 are at:
- "Using the Table Parameter Window" section at http://docs.codecharge.com/studio/html/UserGuide/Forms/FormDataSource.html
- http://docs.codecharge.com/studio/html/QuickStart/Creat...hParam.html?toc
- http://forums.codecharge.com/posts.php?post_id=59273
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
jm
|
| Posted: 05/13/2005, 5:05 AM |
|
Hi Peter
Any place that I see a demo or detail explanation of the question # 1
Thank you
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 05/13/2005, 9:54 AM |
|
Hi,
I provided this information above: please open the "Href Source" property of the link and then click the [+] to add your company id to the URL.
To be more specific after you click the [+] sign please select your database field (company_id or similar) in the "Paremeter source" listbox. Then click "OK" twice.
You should be all set.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
mike wiz
|
| Posted: 05/16/2005, 9:34 AM |
|
Hi!
Thank you for the information. I got that to kind of work... Here's what's going on...
I'm able to pass the variable through the URL to the next page, however, it seems like the next page isn't "accepting" the variable. It sounds like this poster had the same problem...
http://forums.codecharge.com/posts.php?post_id=54325&s_...=pass+variables
I'd like to define a hidden field in the new form to "get" the variable because it sounds simpler. How does one go about doing this?
Thanks!
|
|
|
 |
Nicole
Posts: 586
|
| Posted: 05/17/2005, 2:06 AM |
|
Mike,
If you just need to store an URL parameter value in a hidden field you can use CCGetParam() function to retrieve a value. Here is sample code for Before Show event of a Hidden field (ASP)
Form_name.Hidden_name.Value = CCGetParam(“url_parameter_name”, “default value”)
To find more about this function refer to CCS Online Help http://docs.codecharge.com/studio/html/Components/Funct...tParam.html?toc
_________________
Regards,
Nicole |
 |
 |
|