0

Mysql php query problem

I have two tables one is 'links' and another is 'link-view' where link has 3 coulmns 'lid,link,uid' "lid" has primary key and "link" has value inserted by user and "uid" has userid. The link table is where user adding links and 2nd is "link-view" where all user viewing links by clicking on button, and data inserted on link-view table. view-link has 3 coulmns (vid,uid,lid) uid is who view the link and lid is what was link. i prepare two queries to show results: 1. (select * from link-view where uid = 'userid'") 2. (select * from links where NOT uid="userid" and NOT link="linkid") problem is that the query showing result for uid well but in case link its not working. please help if any can... i need result by comparing two queries but result from only 2nd query. thanks

24th Oct 2019, 8:43 AM
Harry Singh
Harry Singh - avatar
2 Answers
+ 1
Have you tried NOT LIKE? I'm not sure it'll work, but maybe you can try. SELECT * FROM links WHERE NOT uid = 'userid' AND links NOT LIKE '%linkid%' But where did 'userid' and 'linkid' come from?
24th Oct 2019, 9:17 AM
Ipang
0
these are random ids.
24th Oct 2019, 9:22 AM
Harry Singh
Harry Singh - avatar