Creating Dynamic Dropdowns with PHP
  Creating Dynamic Dropdowns with PHP
2D Graphics
3D Graphics
Web Design & Development
Business Applications
Business Development
Databases
Desktop Programming
Operating Systems
Video Editing
Miscellaneous
Newsletter
User Login
  • Username
  • Password
Stats
  • Tutorials: 38,092
  • Categories: 572

Dreamweaver Tutorials : Creating Dynamic Dropdowns with PHP

Using Dreamweaver and PHP to dynamically populate the dropdown menus in your forms. 2 short video sessions will get you started quickly. Creating Dynamic Dropdowns with PHP  tutorial
    View Tutorial

Detailed Information

     Tutorial: Creating Dynamic Dropdowns with PHP
     Date Listed: 2007-03-01
     Submitted By: junjun
     Total Hits: 10620
     Rating Tutorial Rating 2.87Tutorial Rating 2.87Tutorial Rating 2.87Tutorial Rating 2.87Tutorial Rating 2.87 (263 votes)

    Comment On Tutorial     View Tutorial
    Report Broken Link

Oct 23rd, 2007 at 01:45 PM

Good tuturial, I am new to the php/mysql game. I followed his instructions but am getting an error when I try and select from the Car Make Field-

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/j/e/w/jewellman/html/vehicles_search.php on line 10

Here is my code-

<?php
require_once("Connections/Test.php"); // database connection

$Make = $_POST['Make'];

if ($Make) {
///////////////////////////////////////////////
$query = sprintf("SELECT * FROM Model where Model_Id='$Make'");
$result = @mysql_query($query);
$rowModel = mysql_fetch_array($result);
//////////////////////////////////////////////

}
?>

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>

<form id="form1" name="form1" method="post" action="vehicles_search.php">


<select name="Make" onchange="document.forms[0].submit()">
<option value="" selected>Select Make</option>
<option value="1">Audi</option>
<option value="2">BMW</option>
<option value="3">Chevrolet</option>
<option value="4">Dodge</option>
<option value="5">Honda</option>
<option value="6">Mazda</option>
<option value="7">Nissan</option>
<option value="8">Pontiac</option>
</select>

<select name="Model">
<option value="">Select Model</option>
<?php do { ?>

<option value="<?php echo $rowModel['Model_Id']; ?>"><?php echo $rowModel['Model']; ?></option>
<?php }while ($rowModel = mysql_fetch_array($result)); ?>
</select>

</form>

</body>
</html>

 





© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 9 - Follow our Sitemap