I've been trying for hours to make the dropdown work but to no avail.  I am 
able to get the dropdown to show up but What I want the first item to show 
is Categories.  Next when I choose one of the categories the results show 
only one result regardless of the category I choose.   Thank you.

THIS IS IN THE INDEX.PHP file:::::::::::
<form name="form1" action="results.php">
         <select name="ListCategories" id="ListCategories" class="dropleft" 
onChange="if(this.selectedIndex!=0){document.form1.submit();}">
           <option value="0" <?php if (!(strcmp(0, 
$row_SelAllTitle['Sdo_ID'])))  {echo "SELECTED";}?>>Categories</option>
           <?php
do {
?>
           <option value="<?php echo $row_StudioName['Sdo_ID']?>"<?php if 
(!(strcmp($row_StudioName['Sdo_ID'], $row_SelAllTitle['Sdo_ID']))) {echo 
"SELECTED";} ?>><?php echo $row_StudioName['Sdo_Name']?></option>
           <?php
} while ($row_StudioName = mysql_fetch_assoc($StudioName));
   $rows = mysql_num_rows($StudioName);
   if($rows > 0) {
       mysql_data_seek($StudioName, 0);
           $row_StudioName = mysql_fetch_assoc($StudioName);
   }
?>
         </select>
       </form>

THIS IS THE RESULT.PHP file:::::
<?php require_once('../Connections/test.php'); ?>
<?php
mysql_select_db($database_test, $test);
$query_Recordset1 = "SELECT * FROM videotitle";
$Recordset1 = mysql_query($query_Recordset1, $test) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
<form name="form1" id="form1" method="post" action="">
   <?php echo $row_Recordset1['Sdo_ID']; ?> <?php echo 
$row_Recordset1['V_ID']; ?>
   <?php echo $row_Recordset1['V_image']; ?> <?php echo 
$row_Recordset1['40K']; ?>
</form>
<?php echo $row_Recordset1['V_Title']; ?>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>



At 11:19 AM 10/15/2002 -0400, you wrote:
>I take it you're using DW MX and PHP and MySQL? Great combination! I'm
>really glad DW supports this combination now.
>
>What table type (and version of MySQL) are you using. The new version has
>innodb table types built in, but you have to decide to use them. It doesn't
>happen by default. When you use innodb you can declare columns as foreign
>keys and then MySQL will not permit a value to be entered that is not a
>Primary Key in the related table.
>
>Suppose you are building the form for your titles table. You need a dropdown
>lists for the Studios. So you create two recordsets in the page:
>
>1. Select * FROM Titles;
>2. Select StudioID, StudioName FROM Studios;
>
>You tie the form's fields to the first query. You then redefine StudioID as
>a dynamic list, and populate it using the second query. It isn't the most
>intuitive thing in DW but once you get the hang of it, you can move pretty
>quickly.
>
>As for TitleGenres, presumably this would be a related page (it's hard to do
>master-detail forms, much easier to do related pages, especially when you're
>just starting out). Do you know how to do related pages? If not, go through
>the tutorial that shows you how. The manual doesn't contain the example for
>PHP/MySQL, you have to go to the DW site and download it from there. I don't
>have the URL handy but look around it's easy to spot.
>
>In the TitleGenres page, what will end up getting written to the table will
>look something like this:
>
>Title   Genre
>1       3       (Comedy, say)
>1       4       (Thriller, say)
>2       1       (Drama, say)
>3       5       (Children's, say)
>
>So you'll create a recordset from the Genres table, populate your dropdown
>using the Genre names, and retrieve the GenreID from the control. You then
>pass this to the query, which would read something like this:
>
>SELECT VideoTitle, TitleID FROM Titles
>INNER JOIN TitleGenres ON Titles.GenreID = Genres.GenreID
>WHERE Titles.GenreID = 3
>
>Hope this helps.
>
>For a search page that shows a list of titles by genre, say
>
>
>-----Original Message-----
>From: John Chang [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, October 15, 2002 9:31 AM
>To: Arthur Fuller
>Subject: Re: Misunderstandings about SQL
>
>
>OK, I'm getting close to understanding.
>
>When I create the Title and Genre tables and then I create the TitleGenre
>table.  The database knows that the PK from the 2 tables are foreign keys
>in TitleGenre.  Is this correct? OR Is there any command I need to give
>when adding the 2 PKs from the other two tables into TitleGenre so that it
>will be a foreign key?
>
>So when I create the search on the webpage using dreamweaver do I tell the
>front-end to search the Titles table or the whole database to find Genre,
>Titles, Actors, or Studios?  I guess I don't understand how the computer
>will know what to show on the webpage.  I want all that info to come up and
>then when someone clicks (these will be links too search) on the Name,
>studio, Genre it'll show all titles that have the name, genre, or studio.
>
>If I am using TitlesGenres do I need to get rid of GenreID (as you
>mentioned) and add TitleGenres into the Titles table?  Is the Titles table
>suppose to be the compilation of all the tables?  and so I do all my
>searches (select statements) from it?
>
>Studios (StudioName, StudioID)
>  > >Genres (GenreName, GenreID)
>  > >Titles (VideoTitle, Details, StudioID, GenreID, BitRateID, TitleID)
>  > >Actors (F_Name, L_Name, ActorID)
>  > >Stars (TitleID, ActorID)
>TitleGenres (TitleID, GenreID)
>
>At 08:58 AM 10/15/2002 -0400, you wrote:
> >The purpose of normalization is to eliminate redunandant data by splitting
> >the data up into like entities. In the design I offered, you are not
> >actually  duplicating the data in several tables, but rather the foreign
> >keys that point to it.
> >
> >A separate question is, How does the data get into the tables? This is
> >typically the task of the front end you create, whether it's a web page or
> >an Access application or whatever. Typically foreign keys are populated by
> >use of some interface gadget such as dropdown lists.
> >
> >Suppose you are adding titles. In that table you need a value for StudioID.
> >Typically you would create a dropdown list from the Studios table, hiding
> >the StudioID column and showing only the StudioName column. Then the user
> >can select from the list of studios, and what your web page actually stores
> >in the table is the StudioID not the name.
> >
> >Tools such as Dreamweaver make designing such a page very very easy.
> >
> >hope this helps,
> >Arthur
> >
> >----- Original Message -----
> >From: "John Chang" <[EMAIL PROTECTED]>
> >To: "Arthur Fuller" <[EMAIL PROTECTED]>
> >Sent: Tuesday, October 15, 2002 7:33 AM
> >Subject: Re: Normalization sql
> >
> >
> > > So I have to put in data in both the Title, Genre, and TitleGenre?  Then
> > > what is the point of having Title and Genre if I have to put in
> >information
> > > twice?  Or can I put in the data into TitleGenre and will it also put it
> > > into Title and Genre?
> > >
> > > The MySQL is going to be the backend and the webpage will be the
> > > front-end.  All I want it to do is someone searching by title, Genre,
> > > Actors, or studio and it will display on the webpage the outcome.
> > >
> > > Would it be possible to talk with you regarding how to set this up?
> > >
> > > Thank you for your time.
> > >
> >
> >Arthur Fuller
> >Chief Code Monkey
> >ETS Escape Routes Inc.


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to