Code:
$CAT='Bath & Body'; sql="select * from Products where Category = '$CAT'; $result=mysql_query($sql);
Thanks in advance
$CAT='Bath & Body'; sql="select * from Products where Category = '$CAT'; $result=mysql_query($sql);
$CAT='Bath & Body'; sql="select * from Products where Category = '$CAT'; $result=mysql_query($sql);
function removeAllOptions(selectbox)
{
var i;
for(i=selectbox.options.length-1;i>=0;i--)
{
//selectbox.options.remove(i);
selectbox.remove(i);
}
}
function addOption(selectbox, value, text )
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}
function SelectEditProduct()
{
removeAllOptions(document.editproducts.productname);
addOption(document.editproducts.productname,"","select");
<?php
include_once("database.php");
$sql="select * from ProductCategory ";
$result1=mysql_query($sql) ;
while ($rows1=mysql_fetch_row($result1))
{
echo "if(document.editproducts.categoryname.value == '$rows1[1]'){";
$sql="select * from Products where Category ='$rows1[1]'"; // THIS LINE SHOWS ERROR
//$sql="select * from Products where Category='Bath \& Body'";
$result=mysql_query($sql);
while ($rows=mysql_fetch_row($result))
{
echo "addOption(document.editproducts.productname,'$rows[1]', '$rows[2]');";
}
echo "}";
}
?>
}
Comment