dongtong5242 2017-09-29 13:43
浏览 23
已采纳

Echo数组行作为变量sqlserver

I have a problem that I think i understand the issue but I'm stuck for a resolution.

I have a sql query running in PHP as follows:

$sql = "select COUNT(*) From dbo
Where dbo.table.STATUS < 4";

$Backlog = sqlsrv_query($conn,$sql);
if( $Backlog === false) {
    die( print_r( sqlsrv_errors(), true) );
}
while( $Row = sqlsrv_fetch_array( $Backlog, SQLSRV_FETCH_NUMERIC) ) {
      echo $Row[0];
}

My connection to the source is fine and if I put this out via a basic PHP page I get the result of the query printed on the page.

However, I'm trying to call $Backlog on a different page with some CSS formatting:

<?php echo "<div class =second_row_label>Incident Back Log</div><div class =top_num>".$Backlog."</div></div></a>"; ?>

And it's here I'm getting the Resource ID #x error.

From scanning the various pages I believe $Backlog is my resource so the question is, how can I call the result as the variable $Backlog on the second sheet?

  • 写回答

1条回答 默认 最新

  • duanji4870 2017-09-29 13:54
    关注

    If I understand your question correctly I think sessions will solve your problem.

    Store your values to $_SESSION variables. You can then use those $_SESSION variable on any page that includes session_start()

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改