Try running the following query:
Code:
$query = "
SELECT ".PHPDIG_DB_PREFIX."spider.spider_id AS spider_spider_id,
".PHPDIG_DB_PREFIX."spider.site_id AS spider_site_id,
".PHPDIG_DB_PREFIX."sites.site_id AS site_site_id
FROM ".PHPDIG_DB_PREFIX."spider
LEFT JOIN ".PHPDIG_DB_PREFIX."sites
ON (".PHPDIG_DB_PREFIX."sites.site_id = ".PHPDIG_DB_PREFIX."spider.site_id)
ORDER BY ".PHPDIG_DB_PREFIX."spider.spider_id ASC
";
The output should look like below:
Code:
+------------------+----------------+--------------+
| spider_spider_id | spider_site_id | site_site_id |
+------------------+----------------+--------------+
| 1 | 1 | 1 |
| 2 | 1 | 1 |
| 3 | 2 | 2 |
| 4 | 2 | 2 |
| 5 | 2 | 2 |
| 6 | 1 | 1 |
| 7 | 1 | 1 |
| 8 | 1 | 1 |
| 9 | 1 | 1 |
| 10 | 1 | 1 |
| 11 | 1 | 1 |
| 12 | 1 | 1 |
| 13 | 1 | 1 |
| 14 | 1 | 1 |
| 15 | 1 | 1 |
| 16 | 1 | 1 |
+------------------+----------------+--------------+
16 rows in set (0.00 sec)
The files in the text_content directory match with spider_id:
Code:
text_content> ls
1.txt 11.txt 13.txt 15.txt 2.txt 4.txt 6.txt 8.txt keepalive.txt
10.txt 12.txt 14.txt 16.txt 3.txt 5.txt 7.txt 9.txt