php - Updating to mysqli and cant get database to read


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 --!>

        while($objResult = mysqli_fetch_array ($objQuery))
        <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>

People are also looking for solutions to the problem: php - Laravel Sum value and group by


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.