没有在桌子上得到回应 [英] Not getting response on a table

查看:68
本文介绍了没有在桌子上得到回应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在数据库上执行查询,它获得了正确的结果,但该表为空。有什么建议吗?

 <   >  



 < ;?php  

$ userid = $ _ SESSION [' userid'];

$ result = mysql_query( SELECT * FROM companies WHERE company ='$ _ GET [company ]'和car_moto ='$ _ GET [car_moto]'和packet ='$ _ GET [packet]'和userid ='$ userid');
$ num = mysql_num_rows($ result);

$ i = 0;

while ($ i< $ num){
$ f0 = mysql_result($ result,$ i, id);
$ f1 = mysql_result($ result,$ i, company);
$ f2 = mysql_result($ result,$ i, car_moto);
$ f3 = mysql_result($ result,$ i, packet);
$ f4 = mysql_result($ result,$ i, protect);
$ f5 = mysql_result($ result,$ i, price_protect);
$ f6 = mysql_result($ result,$ i, clear_protect);

echo < tr>< td align ='center'>< span> $ f1< / span>< / td>< td align ='center'><> $ f2< / span>< / td>< td align ='center'>< span> $ f3< / span>< / td>< td align ='center'><> $ f4< / span>< / td>< td align ='center'>< span> $ f5< / span>< / td>< td align ='center'><> $ f6< / span>< / TD>< / TR GT&;;
$ i ++;

}

?>



< pre lang =HTML> < / TABLE > ;

解决方案

userid =


_SESSION [' userid'];


result = mysql_query( SELECT * FROM公司WHERE company ='


Doing the query on the database it gets the correct results, but the table is empty. Any suggestion?

<TABLE>


<?php

$userid=$_SESSION['userid'];

$result=mysql_query("SELECT * FROM companies WHERE company='$_GET[company]' and car_moto='$_GET[car_moto]' and packet='$_GET[packet]' and userid='$userid'");
$num=mysql_num_rows($result);

$i=0;

while ($i < $num) {
        $f0=mysql_result($result,$i,"id");
        $f1=mysql_result($result,$i,"company");
        $f2=mysql_result($result,$i,"car_moto");
        $f3=mysql_result($result,$i,"packet");
        $f4=mysql_result($result,$i,"protect");
        $f5=mysql_result($result,$i,"price_protect");
        $f6=mysql_result($result,$i,"clear_protect");

        echo "<tr><td align='center'><span>$f1</span></td><td align='center'><span>$f2</span></td><td align='center'><span>$f3</span></td><td align='center'><span>$f4</span></td><td align='center'><span>$f5</span></td><td align='center'><span>$f6</span></td></tr>";
$i++;

}

?>


</TABLE>

解决方案

userid=


_SESSION['userid'];


result=mysql_query("SELECT * FROM companies WHERE company='


这篇关于没有在桌子上得到回应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆