Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 从Equi Join查询创建的表中获取数据_Php_Mysql - Fatal编程技术网

Php 从Equi Join查询创建的表中获取数据

Php 从Equi Join查询创建的表中获取数据,php,mysql,Php,Mysql,我有一个由sql equijoin创建的表 我想通过获取错误从该表中检索数据 错误是 dname.resource doesn't exist 代码是 <style type="text/css"> a { text-decoration:none; } .Menu { width:150px; float:left; } .fr { width:800px; height:800px; float:right } </sty

我有一个由sql equijoin创建的表 我想通过获取错误从该表中检索数据 错误是

dname.resource doesn't exist
代码是

<style type="text/css">
a
{
    text-decoration:none;
}
.Menu
{
    width:150px;
    float:left;
}
.fr
{
    width:800px;
    height:800px;
    float:right
}

</style>
<div class="Menu">
<?php
mysql_connect("localhost","dbname","password");
mysql_select_db("dbanme");
$sql="select * from NSEIndices_latest";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result))
{
$tpnt=$row['TickerPlantCode'];  //nse indice code
$indexname=$row['IndexName']; //nse indice index name
?>
  <tr>
    <td><a href="http://mastertrade.in/master/wpfiles/gtnsegainers.php?tpnt=<?php echo $tpnt;?>&indexname=<?php echo $indexname;?>" target="fr"><?php echo $indexname;?></a><br></td>
  </tr>
    <?php }?>
    </div>
    <div class="fr">
    <iframe height="780" width="780" scrolling="no" name="fr"></iframe>
    </div>

A.
{
文字装饰:无;
}
菜单
{
宽度:150px;
浮动:左;
}
先生
{
宽度:800px;
高度:800px;
浮球:对
}

am getting error上的gtnsegainer.php页面为 gtnsegainer页面位于iframe中 此页面根据上面页面上的链接从数据库检索数据

<table class="table" cellspacing="0" width="100%">
  <tr>
    <td align="left" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9;">Company Name
      </th>
    <td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">High
      </th>
    <td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">Low
      </th>
    <td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">Last Price
      </th>
    <td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">Prv Close
      </th>
    <td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">Change
      </th>
    <td align="center" valign="middle" style="border:#e7e7e7 1px solid; background-color:#f9f9f9; background-color:#f9f9f9;">%Gain
      </th>
  </tr>
<?php
mysql_connect("localhost","dbname","password");
mysql_select_db("dbname");
$tpnt=$_GET['tpnt'];
$indexname=$_GET['indexname'];
$query="SELECT nsepricequotes_latest.Symbol, nsepricequotes_latest.CompanyName, nsepricequotes_latest.HighPrice, nsepricequotes_latest.LowPrice, nsepricequotes_latest.LastTradedPrice, nsepricequotes_latest.ClosePrice, nsepricequotes_latest.NetChange, nsepricequotes_latest.PercentChange, nse_index_constituents.Tickerplant_index_code
FROM nsepricequotes_latest, nse_index_constituents
WHERE nsepricequotes_latest.TickerPlantCode = nse_index_constituents.TickerPlant_scrip
AND PercentChange >0
ORDER BY PercentChange DESC ";
$result=mysql_query($query);

$query1="Select * from $result where NSE_Index_Name=$indexname";
$result1=mysql_query($query1);
while($row=mysql_fetch_array($result1))
{
$symbol=$row['Symbol'];  
$CompanyName=$row['CompanyName'];
$HighPrice=$row['HighPrice'];
$LowPrice=$row['LowPrice'];
$previousclose=$row['LastTradedPrice'];
$ClosePrice=$row['ClosePrice'];
$netChange=$row['NetChange'];
$percentagechange=$row['PercentChange'];
?>

  <tr>
    <td align="left" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $CompanyName;?></td>
    <td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $HighPrice;?></td>
    <td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $LowPrice;?></td>
    <td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $previousclose; ?></td>
   <td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $ClosePrice;?></td>
    <td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $netChange;?></td>
    <td align="center" valign="middle" style="border-right:#e7e7e7 1px solid; border-left:#e7e7e7 1px solid ;border-bottom:#e7e7e7 1px solid;"><?php echo $percentagechange;?></td>
  </tr>
  <?php } ?>
</table>

公司名称
高的
低的
最后价格
Prv关闭
改变
%获得

在特定的设置中,很难判断错误是什么,但我建议在每个mysql\u查询($query)之后添加一些简单的调试添加如果(mysql_error())死亡(mysql_error())这将为您指明正确的方向