Specifications

As you can see, this is again a pretty simple function. It attempts to delete the bookmark for a
particular user from the database. One thing to note is that we want to remove a particular
username-bookmark pair. Other users might still have this URL bookmarked.
Some sample output from running the delete script on our system is shown in Figure 24.10.
Building Practical PHP and MySQL Projects
P
ART V
532
FIGURE 24.10
The deletion script notifies the user of deleted bookmarks and then displays the remaining bookmarks.
As in the add_bms.php script, when the changes to the database have been made, we display
the new bookmark list using get_user_urls() and display_user_urls().
Implementing Recommendations
Finally, we come to the link recommender script, recommend.php.
There are many different ways we could approach recommendations. We have decided to per-
form what we call a like-mindsrecommendation. That is, we will look for other users who
have at least one bookmark the same as our given user. The other bookmarks of those other
users might appeal to our given user as well.
The easiest way to implement this as an SQL query would be to use a subquery. First, we get
the list of similar users in a subquery, and then we look at their bookmarks in an outer query.
30 7842 ch24 3/6/01 3:34 PM Page 532