dqt83336 2017-06-18 21:57
浏览 18

更新到mysqli并且无法读取数据库

After a upgrade to php7.0 my site won´t read from my database. Dont really understand what´s wrong, it worked before. I can write to the database, so i have connection. I know the code isn´t the nicest, but I´m learning ;)

        <?
    $objConnect = mysqli_connect("localhost","user","password") or die(mysqli_error());
    $objDB = mysqli_select_db($objConnect, "Utedansen");
    $strSQL = "SELECT * FROM anmalan where fnamn !='' ORDER BY intrade DESC, enamn, fnamn";
    $objQuery = mysqli_query($objConnect, $strSQL) or die ("Error Query [".$strSQL."]");

    $result = mysqli_query($objConnect, "SELECT COUNT(*) AS total FROM anmalan where intrade = 'Sponsorbiljett'");
    $count = mysqli_fetch_array($result);
    $result2 = mysqli_query($objConnect, "SELECT COUNT(*) AS total2 FROM anmalan where intrade = 'Matbiljett'");
    $count2 = mysqli_fetch_array($result2);
    $result3 = mysqli_query($objConnect, "SELECT COUNT(*) AS total3 FROM anmalan where intrade = 'Eftersläpp'");
        $count3 = mysqli_fetch_array($result3);
        ?>

        <!-- Further down --!>


    <?
        $count=0;
        while($objResult = mysqli_fetch_array ($objQuery))
    {
        $count=$count+1;
    ?>
      <tr>
        <td><?=$count;?></td>
        <td><?=$objResult["ID"];?></td>
        <td><?=$objResult["BET"];?></td>
        <td><?=$objResult["enamn"];?></td>
        <td><?=$objResult["fnamn"];?></td>
        <td><?=$objResult["telefon"];?></td>
        <td><?=$objResult["email"];?></td>
        <td><?=$objResult["intrade"];?></td>
        <td><div align="center"><input type="checkbox" name="chkDel[]" value="<?=$objResult["ID"];?>"></td></div>
        <td><div align="center"><a href=edit.php?id=<?=$objResult["ID"];?>>Redigera</td></div>
        <td><div align="center"><a href=betalat.php?id=<?=$objResult["ID"];?>>Betalat</td></div>
        <td><div align="center"><a href=paminnelse.php?id=<?=$objResult["ID"];?>>Påminnelse</td></div>
        <td><?=$objResult["Tiden"];?></td>
      </tr>
    <?
    }
    mysqli_close($objConnect);
    ?>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
    • ¥20 软件测试决策法疑问求解答
    • ¥15 win11 23H2删除推荐的项目,支持注册表等
    • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
    • ¥15 qt6.6.3 基于百度云的语音识别 不会改
    • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
    • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
    • ¥15 lingo18勾选global solver求解使用的算法
    • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
    • ¥20 测距传感器数据手册i2c