ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-db
php-db
Re: [PHP-DB] Query's
by other posts by this author
Sep 29 2003 10:18PM messages near this date
[PHP-DB] Defining relation between tables | [PHP-DB] Query's
Are you asking for help with the query, or with having the query populate 
a select box? If you are planning to be able to manually enter search 
criteria, then you do not want a select box, you want a text type input. 

David





"Andrew R" <andrew@[...].org> 

09/29/2003 05:01 PM



 

To:
<php-db@[...].net> 
cc:





Subject:
[PHP-DB] Query's



Howdy List,

I am a little confused in incorporating a drop down menu into my select
statement.
I have a very simple 1 table database that contains my DVD collection.

Right now - very simply it connects to the database, and then produces
the results of the search based on a

<?
  mysql_connect("localhost","name","password"); 
  mysql_select_db("oldmovies");
$result = mysql_query ("SELECT * FROM movies");

while($r=mysql_fetch_array($result))
  {
    $movie_number=$r["movie_number"];
    $movie_name=$r["movie_name"];
    $genre=$r["genre"];
    $star1=$r["star1"];
    $star2=$r["star2"];
    $star3=$r["star3"];
    $director=$r["director"];
    $brief_synopsis=$r["brief_synopsis"];
    $imdb_link=$r["imdb_link"];


?> 
This then produces the results onto the page in the tables that I have
formatted.


This was fine when I only had 50 or so dvd's - I am nearing the 500
mark, and it is WAY past time to add a search

This is where I get lost.

I can get into mysql monitor, and I can pull out using SELECT * FROM
movies WHERE genre LIKE *******
And then I have a selection of Genre's that I can enter to generate the
results.

What I am trying to do is incorporate some selection drop down menus
that would make the search process easier.

Example: search for movies where {dropdown1} is {equal or like}
Dropdown 1 would be my first criteria: movie name, director, lead actor,
genre.
The equal or like would be a standard textfield to be filled in.

I hope that I am making sense here. 

If anybody can shed some light onto a confused newbie (the php script
above was written at my old place of employment for me - otherwise I
could ask them) it would be greatly appreciated.

Thank you
Andrew

------------------------------------------------------

"Come to the edge, Life said. 
They said: We are afraid. 
Come to the edge, Life said. 
They came. 
It pushed them...and they FLEW." 
-Guillaume Apollinaire 1870-1918
-------------------------------------------------------
"Once you have tasted flight, 
you will walk the earth with your eyes turned skyward, 
for there you have been and there you long to return." 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved