Skip to content

Commit

Permalink
Add crawl_tag to query results.
Browse files Browse the repository at this point in the history
  • Loading branch information
terwilligergreen committed Jun 5, 2012
1 parent 2cac027 commit a4d6976
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions query.php
Expand Up @@ -4,15 +4,17 @@
include('includes/functions.php');
include('includes/mysql_functions.php');

$sql = "SELECT url, title, clicks, http_code, size, type, modified, (SELECT count(*) FROM links WHERE `to` = urls.ID) as incoming, (SELECT count(*) FROM links WHERE `to` = urls.ID) as outgoing from urls";
$sql = "SELECT url, title, clicks, http_code, size, type, modified, crawl_tag, (SELECT count(*) FROM links WHERE `to` = urls.ID) as incoming, (SELECT count(*) FROM links WHERE `to` = urls.ID) as outgoing from urls";


if ($_GET) {
$sql .= " WHERE";
$sql .= " WHERE `crawl_tag` = '$crawl_tag' AND ";
foreach ($_GET as $field=>$value) $sql .= " `$field` = '". urldecode($value) . "'";
} else {
$sql .= " WHERE `crawl_tag` = '$crawl_tag'";
}

$sql .= " LIMIT 100";
$sql .= " LIMIT 300";

$pages = mysql_query($sql);

Expand Down

0 comments on commit a4d6976

Please sign in to comment.