|
|
||||||||
|
||||||||
|
||||||||
|
|
|
| Dreamweaver Tutorials : Database Related Tutorials | RSS |
| Adobe Dreamweaver is a web development tool originally owned by Macromedia. It supports CSS, JavaScript, and a number of other web-related technologies. If you're designing web sites using Dreamweaver and want to learn how to get the most out of the technology, the tutorials in this section can help. |
|
| JOIN OUR DREAMWEAVER DISCUSSION FORUM |
|
|
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
- By:
- jewellman
Oct 23rd, 2007 at 01:45 PMGood 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>