BorbleDorbl
New member
0
0%
3
Months of Service
0%
Hello, I am developing a script and I am stuck on the link structure. My goal is to gather all links in a single table to process them, and to develop the menu based on this postlink table. Your suggestions are really important, thank you in advance. Here are my tables:
Table: davpost
- id int(11) AI
- postad varchar(150)
- postdesc varchar(150)
- makale text
- durum int(1)
- tip varchar(10)
Table: postlink
- link_id int(11) AI
- veri_id int(11)
- link_adr varchar(150)
- link_name varchar(150)
- link_type varchar(150)
Table: postag
- tag_id int(11)
- post_id int(11)
Do you have any suggestions for this table structure? If I remove the 'tip' field from the davpost table and postlink table, and modify the postag table to have 'linkid int(11)', 'post_id int(11)', and 'tip varchar(25)', would that be more logical? In that case, the table structure would be:
Table: davpost
- id int(11) AI
- postad varchar(150)
- postdesc varchar(150)
- makale text
- durum int(1)
Table: postlink
- link_id int(11) AI
- link_adr varchar(150)
- link_name varchar(150)
Table: postag
- linkid int(11)
- post_id int(11)
- tip varchar(25)
In this scenario, my SQL query would be:
"SELECT g.*, p.*, l.* FROM davpost AS g INNER JOIN postag AS p ON g.id=p.post_id LEFT JOIN postlink AS l ON p.link_id=l.linkid WHERE g.id=6
Table: davpost
- id int(11) AI
- postad varchar(150)
- postdesc varchar(150)
- makale text
- durum int(1)
- tip varchar(10)
Table: postlink
- link_id int(11) AI
- veri_id int(11)
- link_adr varchar(150)
- link_name varchar(150)
- link_type varchar(150)
Table: postag
- tag_id int(11)
- post_id int(11)
Do you have any suggestions for this table structure? If I remove the 'tip' field from the davpost table and postlink table, and modify the postag table to have 'linkid int(11)', 'post_id int(11)', and 'tip varchar(25)', would that be more logical? In that case, the table structure would be:
Table: davpost
- id int(11) AI
- postad varchar(150)
- postdesc varchar(150)
- makale text
- durum int(1)
Table: postlink
- link_id int(11) AI
- link_adr varchar(150)
- link_name varchar(150)
Table: postag
- linkid int(11)
- post_id int(11)
- tip varchar(25)
In this scenario, my SQL query would be:
"SELECT g.*, p.*, l.* FROM davpost AS g INNER JOIN postag AS p ON g.id=p.post_id LEFT JOIN postlink AS l ON p.link_id=l.linkid WHERE g.id=6