close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Creating the Dynamic Array / text or data

Thread began 11/15/2009 3:33 pm by brunodarwin371999 | Last modified 1/08/2011 10:15 pm by MR.gabriel | 3103 views | 9 replies |

brunodarwin371999

Creating the Dynamic Array / text or data

Hi,

In my data base, let's say that :
- the Parent is "articles"
- the Child list "spares" is the corresponding spare parts list (screw, O-ring, nut) for each above "article"

My question referes to the pdf "Getting Started with Dyamic Dropdowns", page 7 of 10 , point 7
> We have to "choose the text or data for the child table".

Question : What can be the column that contains text or data if my Child table is made with the following columns : idspares (PK) ,screw, O-ring, nut, idarticle (FK) ?

Thank you in advance.

Sign in to reply to this post

Jason ByrnesWebAssist

We need a little more information.

How do Articles relate to spares?

How is the database constructed?

Sign in to reply to this post

brunodarwin371999

here is the requested information

Hi Jason,

You will find attached a .jpg file to show you visualy the structure of the dataBase.

Hereunder, here is the SQL file which corresponds to it :

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';

CREATE SCHEMA IF NOT EXISTS `wa_sample` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
USE `wa_sample`;

-- -----------------------------------------------------
-- Table `wa_sample`.`articles`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `wa_sample`.`articles` (
`idarticles` INT NOT NULL AUTO_INCREMENT ,
`article` VARCHAR(45) NOT NULL ,
PRIMARY KEY (`idarticles`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `wa_sample`.`spares`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `wa_sample`.`spares` (
`idspares` INT NOT NULL AUTO_INCREMENT ,
`screw` VARCHAR(45) NULL ,
`o-ring` VARCHAR(45) NULL ,
`nut` VARCHAR(45) NULL ,
`articles_idarticles` INT NOT NULL ,
PRIMARY KEY (`idspares`) ,
INDEX `fk_spares_articles` (`articles_idarticles` ASC) ,
CONSTRAINT `fk_spares_articles`
FOREIGN KEY (`articles_idarticles` )
REFERENCES `wa_sample`.`articles` (`idarticles` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;



SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

Sign in to reply to this post

Jason ByrnesWebAssist

I'm not sure i understand this database structure.

Can you sand a screen shoot showing the data in these two tables.

Sign in to reply to this post

brunodarwin371999

You will find attached a drawing helping you to understand this database struture.

to sum up, article#1 generates 3 spares :
- Screw#1
- o-ring#1
- nut#1

article#n generates 3 spares :
- Screw#n
- o-ring#n
- nut#n

I hope this helps.

Sign in to reply to this post

Jason ByrnesWebAssist

This is basiclythe same screen shot as in your previous post.

Please provide a screen shoot showing the data in the 2 tables, not the structure so I can get a better understanding.

Sign in to reply to this post

brunodarwin371999

Please find attached the two tables parent (articles) and child (spares) data.

The two pictures belong to a phpmyadmin screen capture...

Sign in to reply to this post

Jason ByrnesWebAssist

this Database structure will not work with dynamic drop downs.

your database structure should be more like:

articles:
articleId - primary Key
articleName - text


sparetypes:
spareTypeID - primary Key
sapreTypeName - text


articlespares:
articlesparesID - primary key
articlesparesSpareTypeID - foregin key to sparetypes.spareTypeID
articlesparesarticleId - foregin key to articles.articleId

Sign in to reply to this post

MR.gabriel

Creating Dynamic Array Proplem GSG...

My issue is similar in that I'm going throught the GSG for Dynamic Dropdown and on page 7 at point "5. From the Parent ID field menu, choose the ParentID column."

Once I've chosen the "Child table" (from point #4) It doesn't give me the option to select the Parent ID for the "Parent ID field:". Only the ChildID (that was established by my record sed) shows.

I've checked my DB (phpMyAdmin) and the foreign key was created and the Parent and Child tables are related. I am stuck.

Help Please!
===============================
-- Table structure for table `Child`
--

CREATE TABLE `Child` (
`ChildID` int(20) NOT NULL auto_increment,
`ChildText` text NOT NULL,
PRIMARY KEY (`ChildID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `Child`
--


--
-- Constraints for dumped tables
--

--
-- Constraints for table `Child`
--
ALTER TABLE `Child`
ADD CONSTRAINT `Child_ibfk_1` FOREIGN KEY (`ChildID`) REFERENCES `Parent` (`ParentID`) ON DELETE CASCADE ON UPDATE CASCADE;

===================================

-- Table structure for table `Parent`
--

CREATE TABLE `Parent` (
`ParentID` int(20) NOT NULL auto_increment,
`ParentText` text NOT NULL,
PRIMARY KEY (`ParentID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `Parent`
--

Sign in to reply to this post

MR.gabriel

Fixed, Database was the problem

My database "Chlid" was missing the Parent ID as a column. Once I did that then indexed it Dynamic Array was able to detect it.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...