I use this query to insert data to the table.....
$res = "INSERT INTO `indianw_phpsite`.`ibwf_bookmarks` (`id` ,`userid` ,`topic`) VALUES (NULL , '".$uid."', '".$tpcid."')";
Now the table is in this form.......
id --- userid --- topic
1 --- 8 --- 4561
2 --- 8 --- 7895
3 --- 7 --- 3451
4 --- 5 --- 3415
5 --- 45 --- 1245
6 --- 56 --- 7458
7 --- 78 --- 1235
8 --- 7 --- 1235
. --- . --- .
. --- . --- .
. --- . --- .
. --- . --- .
This is basically a bookmark table, when a User(with a specific userid) bookmarks a topic(which also has a specific id), the data gets stored in the table in that form.... I hope u understand....
Now the problem is I want to apply the limit so that each user should only have 10 bookmarks... It can be found out by finding how many times the user id of that user has appeared in the table.....
For eg. if the person with userid 8 has stored 10 bookmarks, he should not be able to store more bookmarks...... What would be the query to find out this???? I hope u understand....
And also what would be the Query to check no same topic exists with same id twice, or he doesnt bookmark the same topic twice......
Pleae help..... Thanx! 🙁