问题描述
我有以下代码,我很难获得
的工作。我认为这可能是一个问题,$ got查询正在运行,好像我将其设置为设定值,然后我的网站似乎运行正常,但
我还检查了在$ detail $ [1]中持有的数据,通过
回显它们,这是完美的。我已经对这些值进行了改编,并且直接在mysqql中运行了
查询,它给了我很好的结果我是b $ b期待的!
我已经上了好几个小时了,我不能让它工作所以任何帮助
将是太棒了,
让我成为一个幸福的人第一篇文章!
谢谢
Stu
< select name =" type">
<?PHP
$ mod =(从模块中选择名称);
$ modnames = @mysql_query($ mod);
$ getfulltype =(" select modules.name from modules,devices
>
modules.code = $ detailsrow [1] and devices.type = $ detailsrow [1]" ;);
$ got = mysql_query($ getfulltype);
while($ row = mysql_fetch_row($ modnames))
{
if($ got == $ row [0])
{
echo("< option)选择值= \" $ got \"> $ got< / option>");
}
else {
echo("< option value = \" $ row [0] \"> $ row [0]< / option>" );
}
}
?>
< / select>
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($mod);
$getfulltype = ("select modules.name from modules, devices where
modules.code= $detailsrow[1] and devices.type = $detailsrow[1]");
$got = mysql_query($getfulltype);
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>
推荐答案
中的数据
这篇关于麻烦加入查询,查询只是剂量产生结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!