angelamartin
03-25-2007, 12:04 AM
hello,
What is the SQL statement for adding a new listing on Category Level 3.
Your help is highly appreciated.
Thank you,
angela
Dave Baker
03-25-2007, 08:13 PM
Hello angela,
If you have categories:
1. category with id = 1
2. subCategory with id = 2
3. subSubCategory with id = 3
You should execute 2 queries:
1.
INSERT INTO `{prefix}links` (`id`, `id_editor`, `domain`, `url`, `description`, `email`, `reciprocal`, `recip_valid`, `ip_address`, `link_header`, `status`, `pagerank`, `rank`, `date`, `owner`, `comment`, `clicks`, `partner`, `partners_start`, `featured`, `feature_start`, `sponsored`, `sponsored_start`, `sponsored_plan_id`, `sponsored_tid`, `comments_active`, `comments_total`, `num_votes`, `rating`, `min_rating`, `max_rating`, `title`, `last_check_date`, `cron_cycle`, `sponsored_notif_sent`, `notif_sent_date`) VALUES (12, 0, 'www.test.com', 'http://www.test.com', 'description of link', 'admin3@admin.com', 'http://', '0', '127.0.0.1', 200, 'active', -1, 0, '2007-03-11 21:28:14', 0, '', 2, '0', NULL, '0', NULL, '1', NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 'test', NULL, '0', '0', NULL);
This query add data about the link in a table _links
2.
INSERT INTO `{prefix}link_categories` (`id_link`, `id_category`, `crossed`) VALUES (12, 3, '0');
12 - link id
3 - category id (category of new link)
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.