MySQL dynamic drop down menu

Codes here !

Moderators: egami, macek, gesf

Post Reply
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 824
Joined: Sun Jun 02, 2002 3:09 am

Fri Nov 29, 2002 2:52 am

can you show me a script and say what errors you get.

Oleg Butuzov
Last Samuray
Last Samuray
Posts: 824
Joined: Sun Jun 02, 2002 3:09 am

Fri Nov 29, 2002 4:54 am

I make a litlle corections, but i did not find any error.
Can you you te me what was wrongm what error you get ?

Code: Select all

<HTML> 
<HEAD>
<TITLE>show car</TITLE>
</HEAD>
<BODY>
<FORM action="http://localhost/view.php" method="GET">

<?php
$host = "localhost";
$user = "root";
$pass = "";
$db = "DVD";
$table = "list";

$link = mysql_connect($host, $user, $pass);
if(!$link) die(mysql_error());
$select = mysql_select_db($db);
if(!$select) die(mysql_error());

$query = "SELECT name FROM list";
$result = mysql_query($query);
if(!$result) die(mysql_error());

echo "search:<br>\n";
echo "<select name=nam>\n";
echo "<option value=''> </option>\n";
while($row = mysql_fetch_array($result))
{
echo "<option value='$row[name]'>$row[name]</option>\n";
}
echo "</select>\n";
mysql_connect(close);
?>

<input type="submit" value="submit">
</FORM>
</BODY>
</HTML>

Oleg Butuzov
Last Samuray
Last Samuray
Posts: 824
Joined: Sun Jun 02, 2002 3:09 am

Fri Nov 29, 2002 6:57 am

i test your script under Apache . It is all ok.

Is it posibil to change server ?

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests