Re: How to do pass on information...

From: Date: Sun, 08 Sep 2002 01:51:55 +0000
Subject: Re: How to do pass on information...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-115636@lists.php.net to get a copy of this message
Can't you make a form? Lets say you have a lexical database for categories like:
ID    NAME
1     Anime
2     Action
etc... then in the form so: <select name='cat'> <?php $query = "select * from categories"; $result = run_query($query); while($row = fetch_array($result) { echo "<option value=$row[0]>$row[1]</option>"; } free_result($result) ?> </select> This would send to the form action page the numerical representation of the categoried selected from the drop down list. -Brad Chuck PUP Payne wrote:
Hi, I would like to know if there is a way that I can pass on an information from a pull down menu into a sql query. Right now I have to right a PHP page for each piece I am wanting to pass on. Example I have a movie database and now if I want to see what is in my Anime Category that starts with "A" I have to create a page like this: Select * FROM database WHERE category = 'anime' AND title like 'A%' I know I have to do an array? Would it be like this? $category $letter Select * FROM database WHERE category = '$category' and title is like '$letter' But it get to the sql statement is where I am lost. Chuck Payne Magi Design and Support


« previous php.general (#115636) next »