in reply to Limit loop
-- supposing favorites are attached to user records CREATE TABLE user_favorites ( userid integer not null, title varchar(100) not null, link varchar(255) not null, num integer not null, PRIMARY KEY (userid, title), FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE );
Or, even if you hate the idea of a second table, you could store favorites as JSON and on most modern databases you can also reach into that with SQL.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Limit loop
by htmanning (Friar) on Aug 31, 2022 at 19:39 UTC |