Click here to Skip to main content
14,575,017 members
Rate this:
Please Sign up or sign in to vote.
Hi, I created a system and trying to extract information from a database, but I'm throwing an error message "Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given", I don't know what to do, help. Thank you

PHP code:

            $query = "SELECT * FROM darb WHERE darb_id = ? ";
            $select_darb = mysqli_query($connection, $query);

            while ($row = mysqli_fetch_assoc($select_darb)) {
                $darb_id            = $row['darb_id'];
                $darb_user          = $row['darb_user'];
                $darb_title         = $row['darb_title'];
                $darb_date          = $row['darb_date'];
                $darb_result        = $row['darb_result'];
                $darb_fileUpload    = $row['darb_fileUpload'];
                $darb_payment       = $row['darb_payment'];

                echo "<tr>"; ?>


                echo "<td>$darb_id </td>";

                echo "<td>$darb_user</td>";

                echo "<td>$darb_title</td>";

                echo "<td>$darb_date</td>";

                echo "<td>$darb_result</td>";

                echo "<td>$darb_payment</td>";

                echo "<td><a href='../uploads/$darb_fileUpload'>$darb_fileUpload</a></td>";?>





What I have tried:

I have tried a lot of advice online but couldn't resolve this problem.
Updated 28-May-20 22:09pm
phil.o 28-May-20 19:10pm
You could start by clicking on the numerous links at the right side of this page which relate to this issue :)
Richard MacCutchan 29-May-20 4:09am
I think I'm going to be a rich man ... :)

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Matas - developer 30-May-20 20:15pm
I fix this problem, thank you, but I have another problem, it doesn't show info by id, can you help me? code is the same, but I added two lines
            $darb_id = 'darb_id';
            $query = "SELECT * FROM darb WHERE darb_id = '{$darb_id}' ";
Richard MacCutchan 31-May-20 3:56am
You are setting your query parameter to the string value 'darb_id'. I do not think that is what you want.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100