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()

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

报告相同问题?

悬赏问题

  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab