Depending on various users preferences, there are no ONE solution. But here are some ideas:
Code: Select all
CREATE TABLE `links` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
`cat` VARCHAR( 50 ) NOT NULL ,
`subcat` VARCHAR( 50 ) NOT NULL ,
`url` VARCHAR( 200 ) NOT NULL ,
`linkname` VARCHAR( 50 ) NOT NULL ,
PRIMARY KEY ( `id` )
) COMMENT = 'Links';
Pretty selfexplainatory:
id - the id of the link. generally a good idea. (Ex: 1)
cat - categories (Ex: PHP)
subcat - subcategories (Ex: Coding Resources)
url - what you put in href (Ex:
http://forums.devnetwork.net/)
linkname - name (Ex: PHPDN)
Inserting something...
Code: Select all
INSERT INTO `links` ( `id` , `cat` , `subcat` , `url` , `linkname` )
VALUES (
'', 'PHP', 'Coding Resources', 'http://forums.devnetwork.net/', 'PHPDN'
);
As the 'id' is set to AUTO_INCREMENT, two single quotes is enough. MySQL will itself add the next number in line.
After a while, you will have a huge selection of links, and by using code like
Code: Select all
select * from links where car = 'PHP'
...you can get all links that has to do with that general area.
Writing an example of the entire script (especially the output to a page part) would take up a whole page with commenting, so I'd suggest you look into prewritten snippets of it on the web (
http://www.evilwalrus.com, hotscripts.com perhaps) and go from there.
Hope I was of some help & good luck.