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

 Help - need to display a field from another table!

Print topic Send  topic

Author Message
bas60

Posts: 18
Posted: 09/09/2011, 5:22 AM

Did a search - probably not asking the right question!

I have a DB with Manufacturers table with 2 fields - manufacturer_id &
manufacturer_name

I have products file with a link manufactuers_id

I need to display the Manufacturer name on my products page

I've sure I've done this before with code expression

something like 'select manufacturer_name from manufacturers where
manufacturers.manufacturer_id=manufacturer_id' but its not working today!

its actually displaying the above sql!!

aaaaargghhhh

View profile  Send private message
datadoit
Posted: 09/09/2011, 7:04 AM

For your label or textbox control, in the BeforeShow choose the DLookup
Action. From there just fill in the blanks.
jacem

Posts: 87
Posted: 09/09/2011, 9:27 PM

Here is a little extra help in using the BeforeShow 'Dlookup' action event:
For expression enter "manufacturer_name"
For Domain enter "Manufacturers"
For Criteria enter "manufacturer_id=$Container->manufacturer_id->GetValue()"
For Connection enter databasenameDB as per your connection settings for the DB name
For convert result to enter Text
For Type of Target enter Control
for Target enter ManufacturerName or what ever the label is named that will hold the manufactures name on the page.
Notice above that the last four items don't have " encasing the answers but the first three do. Its a set up quirk of CCS

Hope this helps.
View profile  Send private message
bas60

Posts: 18
Posted: 09/10/2011, 10:12 AM

Thanks for the detailed info but it didn't work.
the manufacturer name is not displayed!

I the modified the page and added manufacturer_id - as I previously didn't
I assumed "manufacturer_id=$Container->manufacturer_id->GetValue()" would
need manufacture_id on the page... Anyway if I add this I get

Catchable fatal error: Object of class clsControl could not be converted to
string in /home/site/public_html/machines/prod_detailsY_events.php on line
109

What I am doing wrong??

View profile  Send private message
bas60

Posts: 18
Posted: 09/10/2011, 3:43 PM

Ok deleted and re-added manufacturer_id set to text

Still manufacturername is blank

Now if I replace this
$ccs_result = CCDLookUp("manufacturer_name", "manufacturers", "manufacturer_id=$Container->manufacturer_id->GetValue()", $Page->Connections["machines"]);

with

$ccs_result = CCDLookUp("manufacturer_name", "manufacturers", "manufacturer_id=292", $Page->Connections["machines"]);

Then manufacture with ID 292 is displayed

so "manufacturer_id=$Container->manufacturer_id->GetValue()" should be ok since the control is manufacturer_id

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.

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.