List:General Discussion« Previous MessageNext Message »
From:Andrew Date:November 10 2003 11:22am
Subject:select option from associated id query
View as plain text  

Hi All MySQL users

I am having a slight problem and getting inot a bit of a tizz.

I have two tables and I am trying to produce a dropdown select menu whilst
creating a join.  The two tables are as follows...

CREATE TABLE itinerary (
  i_id int(3) unsigned NOT NULL auto_increment,
  i_title varchar(100) default NULL,
  i_description mediumtext,
  i_category int(3) unsigned default NULL,
  i_ordernumber int(3) unsigned default NULL,
  i_text mediumtext,
  i_image1 varchar(255) default NULL,
  i_image2 varchar(255) default NULL,
  i_image3 varchar(255) default NULL,
  PRIMARY KEY  (i_id),
  UNIQUE KEY i_id (i_id),
  KEY i_id_2 (i_id)


  d_id int(3) unsigned NOT NULL auto_increment,
  d_objid int(3) unsigned default NULL,
  d_startdate date default NULL,
  d_enddate date default NULL,
  PRIMARY KEY  (d_id),
  UNIQUE KEY d_id (d_id),
  KEY d_id_2 (d_id)

The two fields that are associated are dates2.d_objid and itinerary.i_id what I
want to do is pull out the dates for a selected itinerary.i_id and present them
in a select menu.  I am using php but it's been a while and have only got so far
inot a tizz :)

Can anyone shed a little light on the quesry or a bit of guidance on how to
approach this?

Thank you

select option from associated id queryAndrew10 Nov
  • RE: select option from associated queryAndrew10 Nov