Category : sql

So I have a php page that looks like this enter image description here <?php echo "<table border=’1′ width= 300px > <tr> <th>Friend Names</th> <th>Remove Friends</th> </tr>"; while($row = mysqli_fetch_assoc($result2)) { $friend_id_got = $row[‘friend_id2’]; $query3 = "SELECT profile_name from friends where friend_id = ‘$friend_id_got’ "; $result3 = $conn->query($query3); $final3 = mysqli_fetch_assoc($result3); echo "<tr>"; echo "<td>" ..

Read more

1.Create a public static method called all. This method’s purpose is to retrieve all categories from the database and create category objects with all their properties populated. Within the all method, create a new variable called $sql. This will contain an SQL statement to retrieve all categories from the ‘categories’ table. Recall, the syntax for ..

Read more

I have this field <input class="red-heart-checkbox " name="photo[]" type="checkbox" value="<?php echo $id; ?>" id="<?php echo $id; ?>" data-img="<?php echo $imageURL; ?>"/> And I would like to make a list of image with url image from the data-img checked but I only have values with this code : <script> $(function() { var masterCheck = $("#masterCheck"); var ..

Read more

I have 2 tables: subscribers-> id, updated_at payments-> id, subscriber_id, updated_at $query->leftJoin( $this->paymentsTable, "$this->paymentsTable.subscriber_id", "=", "$this->subscribersTable.id" ); I want to select new column "last_update", which are MAX(updated_at) from 2 joined tables eg. subscriber 1, 2021-01-01 subscriber 2, 2020-02-02 payment 1, 1, 2020-03-03 payment 2, 2, 2021-02-02 payment 3, 1, 2022-02-02 last_update for subscriber1 = 2022-02-02 ..

Read more