0

I'm designing a small application using pure PHP. I'm not going to use frameworks. This is my ER diagram.

ER Diagram

Users can add one or more user notes. And each note can be tagged by user. Users can search by note title, content and also note tags.

  • When I'm going to show all notes in one page, I can get user details and note details in one query. But after that I need to retrieve tags using another query in a foreach loop. Is this good way to implement this?
  • I have seen when I'm using some frameworks they retrieve data in a collection of array. How can I achieve this?
  • I'm trying to give sorting feature using tags. I'm confusing that how do I sort notes using set of tags? Is there any way to achieve this also?
cha
  • 730
  • 2
  • 12
  • 28
  • Actually I don't have time to practice them now. – cha Oct 28 '14 at 04:13
  • 2
    you can try using group_concat() in mysql which will help you to get the associated tags for your note in one query – Manigandan Arjunan Oct 28 '14 at 04:17
  • I see no reason why you couldn't get all notes and note rags in a single query – Mike Brant Oct 28 '14 at 04:28
  • Thanks. I will check this. I have added another question regarding sorting using tags. – cha Oct 28 '14 at 04:29
  • @MikeBrant Yes. As Manigandan Arjunan suggests I can retrieve them by grouping and concat them together and join with main query. Is this you think? – cha Oct 28 '14 at 04:35
  • Don't use Frameworks !!! Rasmus Lerdorf itself explains why :) https://www.youtube.com/watch?v=anr7DQnMMs0 – Solrac Oct 28 '14 at 04:38

0 Answers0