Selecting Data from one table for use in another table

2 posts by 2 authors in: Forums > CMS Builder
Last Post: April 4, 2013   (RSS)

By gregThomas - April 4, 2013

Hi,

I think you're going about this the right way, is there a particular problem that you're coming across? 

The only change I think you might need to make is to your select statement:

SELECT package_websites FROM cms_package_websites WHERE package_type='<?php echo $ESCAPED_FILTER_VALUE ?>'    refresh when package_type changes

The select part of your statement should contain the two fields that you want to be the value and label for the drop down, at the moment if looks as if you're using a table name. This post has a good example of how to use the system:

http://www.interactivetools.com/forum/forum-posts.php?postNum=2218572#post2218572

Your select statement should probably look something like this:

SELECT value_field, label_field FROM cms_package_websites WHERE package_type='<?php echo $ESCAPED_FILTER_VALUE ?>'    refresh when package_type changes

You would need to change value_field and label_field to the names of two fields from the cms_package_websites section you want to be your values and labels for the field. Finally, the field in your where statement should be the list field that stores the package_type values.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com