I have the following code which I am having difficulty getting to
work. I think it may be a problem with the $got query that is being
run as if I set that to a set value then my site seems to run ok, but
I also have checked the data whichi is being held in $detailsrow[1] by
echoing them and it is perfect. I have also sutstituted the values and
ran the query in mysqql directly and it gives me the exat results I am
expecting!
Ive been on it for hours now and I cant get it to work so any help
will be fantastic,
Make me a happy man with my first post!
Thanks
Stu
<select name="type">
<?PHP
$mod = ("select name from modules");
$modnames = @mysql_query($m od);
$getfulltype = ("select modules.name from modules, devices where
modules.code= $detailsrow[1] and devices.type = $detailsrow[1]");
$got = mysql_query($ge tfulltype);
while($row = mysql_fetch_row ($modnames))
{
if ($got == $row[0])
{
echo ("<option selected value=\"$got\"> $got</option> ");
}
else {
echo ("<option value=\"$row[0]\">$row[0]</option>");
}
}
?>
</select>
work. I think it may be a problem with the $got query that is being
run as if I set that to a set value then my site seems to run ok, but
I also have checked the data whichi is being held in $detailsrow[1] by
echoing them and it is perfect. I have also sutstituted the values and
ran the query in mysqql directly and it gives me the exat results I am
expecting!
Ive been on it for hours now and I cant get it to work so any help
will be fantastic,
Make me a happy man with my first post!
Thanks
Stu
<select name="type">
<?PHP
$mod = ("select name from modules");
$modnames = @mysql_query($m od);
$getfulltype = ("select modules.name from modules, devices where
modules.code= $detailsrow[1] and devices.type = $detailsrow[1]");
$got = mysql_query($ge tfulltype);
while($row = mysql_fetch_row ($modnames))
{
if ($got == $row[0])
{
echo ("<option selected value=\"$got\"> $got</option> ");
}
else {
echo ("<option value=\"$row[0]\">$row[0]</option>");
}
}
?>
</select>
Comment