I'm making some dynamic drop down boxes for a site that get their contents from a database, i belive i have the correct code to do this
<?php
echo "Product Code";
$sql = "SELECT DISTINCT Product_Code FROM product_supplier";
$result = mysql_query($sql, $odbc) or die("could not run");
echo"<select name = Product_Code>";
echo"<option value = All >All</option>";
while($row=mysql_fetch_object($result))
{
echo "<option value = '".$row->Product_Code."'>$row->Product_Code</option>";
}
echo"</select>";
echo "</p>";
?>
Whenever i try to run it in the webpage it brings this error
Warning: mysql_query() expects parameter 2 to be resource, null given in F:\xampp\xampp\htdocs\G4U\G4U\purchase.php on line 30
Can anybody see whats wrong with it???