/    Sign up×
Community /Pin to ProfileBookmark

Hi everybody,

I have this search script that indexes my site fine, then when it comes to the results page it only displays the first page of results. Now it creates many pages that has results on like 1 2 3 4 5 6 7 etc… Now eventually I would like to do what google do and have < > either side after 1 – 10 so it wont ruin the layout of the page (but that will be later hopefully) as at the moment it displays 1 – 70 if you search for a major keyword.

If you go to [url]www.sunpipe.co.uk[/url] and on any page it will conduct a search which will bring up a new window (Search for Sunpipe, most popular). the results work fine on the 1st page, but if you click on the next page they aren’t there?? I can’t understand why. This does use templates aswell.

Can anyone help me please, I will post the rest of the code?

Heres the form that

[code=php]
<?php function __get($key) { return isset($_GET[$key]) ? htmlentities($_GET[$key]) : “”; } ?>
<form method=”get” target=”top” action=”/search/index.php”>
<input class=”text” type=”text” name=”allwords” value=”<?=__get(“allwords”);?>” />
<input class=”submit” onMouseOver=”this.classname=upstate” onMouseOut=”this.classname=hoverstate” type=”submit” value=”Search” />
<input type=”hidden” name=”offset” value=”0″ />
<input type=”hidden” name=”words” value=”<?=__get(“words”);?>” /> <!– At least one of these words –>
<input type=”hidden” name=”nowords” value=”<?=__get(“nowords”);?>” /> <!– None of these words –>
</form>
[/code]

Heres the display function from the api page:

[code=php]
// —– Display —————————————————————

function display($results, $words, $allwords, $nowords,
$offset, $limit, $numrows, $time,
$template_all, $template_ind, $template_cur, $template_ref, $template_non)
{
if ($numrows == 0)
{
echo $template_non;
return;
}

$ind = “”;

for ($i = 0; $i < (integer)(($numrows+$limit-1)/$limit); $i++)
{
$trans = Array(“%%page%%” => $i+1,
“%%offset%%” => $i*$limit,
“%%words%%” => urlencode($words),
“%%allwords%%” => urlencode($allwords),
“%%nowords%%” => urlencode($nowords));
if ($i*$limit == $offset)
$ind .= strtr($template_cur, $trans);
else $ind .= strtr($template_ind, $trans);
}

$ref = “”;

foreach ($results as $i => $result)
{
$trans = Array(“%%url%%” => $result[“url”],
“%%title%%” => $result[“title”],
“%%excerpt%%” => $result[“excerpt”]);

$ref .= strtr($template_ref, $trans);
}

$trans = Array(“%%ind%%” => $ind,
“%%ref%%” => $ref,
“%%numrows%%” => $numrows,
“%%time%%” => $time);
echo strtr($template_all, $trans);
}

?>
[/code]

Heres the inc_results page:

[code=php]
<?php

if (isset($_GET[‘words’]))
{
include_once “init.php”;

$offset = isset($_GET[‘offset’ ]) ? (integer)$_GET[‘offset’] : 0;
$words = isset($_GET[‘words’ ]) ? strtolower($_GET[‘words’ ]) : ”;
$allwords = isset($_GET[‘allwords’]) ? strtolower($_GET[‘allwords’]) : ”;
$nowords = isset($_GET[‘nowords’ ]) ? strtolower($_GET[‘nowords’ ]) : ”;

$time = microtime(true);
$result = search(preg_split(“/[^a-z]+/”, $words, -1, PREG_SPLIT_NO_EMPTY),
preg_split(“/[^a-z]+/”, $allwords, -1, PREG_SPLIT_NO_EMPTY),
preg_split(“/[^a-z]+/”, $nowords, -1, PREG_SPLIT_NO_EMPTY),
$offset, $src_results_per_page, $numrows);
$time = microtime(true)-$time;
$time = number_format($time, 2, ‘.’, ”);

$template_all = file_get_contents(“template_all.txt”);
$template_ind = file_get_contents(“template_ind.txt”);
$template_cur = file_get_contents(“template_cur.txt”);
$template_ref = file_get_contents(“template_ref.txt”);
$template_non = file_get_contents(“template_non.txt”);

display($result, $words, $allwords, $nowords,
$offset, $src_results_per_page, $numrows, $time,
$template_all, $template_ind, $template_cur, $template_ref, $template_non);
}

?>

[/code]

to post a comment
PHP

8 Comments(s)

Copy linkTweet thisAlerts:
@solidaritiauthorJun 14.2006 — init.php
[code=php]
// MySQL table names
$src_table_urls = "src_engine_urls";
$src_table_index = "src_engine_index";
// Setting $src_replace to true will allow replacing tables that already exist
$src_replace = true;
// Maximum number of pages to be spidered during setup
$src_spider_max = 1000;

// Where to start and end parsing the page
$src_text_start = false;
$src_text_end = false;

// Recognize word forms (if you search for "cat" you will also find "cats")
$src_word_forms = true;

// Number of results per page
$src_results_per_page = 30;

// ----- Initialization --------------------------------------------------------

mysql_connect($src_host, $src_login, $src_password);
mysql_select_db($src_database);

include_once "api.php";

$src_urls = new TMySQL_KeyVal();
$src_urls->init($src_table_urls, 'urls_');

$src_index = new TMySQL_WordId();
$src_index->init($src_table_index, 'index_');
[/code]


api.php

[code=php]
// ----- Parse HTML ------------------------------------------------------------

function enclose($start, $end1, $end2)
{
return "$start((?:[^$end1]|$end1(?!$end2))*)$end1$end2";
}

function parse($html, &$title, &$text, &$anchors, $start = false, $end = false)
{
$pstring1 = "'[^']*'";
$pstring2 = '"[^"]*"';
$pnstring = "[^'">]";
$pintag = "(?:$pstring1|$pstring2|$pnstring)*";
$pattrs = "(?:\s$pintag){0,1}";

$pcomment = enclose("<!--", "-", "->");
$pscript = enclose("<script$pattrs>", "<", "\/script>");
$pstyle = enclose("<style$pattrs>", "<", "\/style>");
$pexclude = "(?:$pcomment|$pscript|$pstyle)";

$ptitle = enclose("<title$pattrs>", "<", "\/title>");
$panchor = "<a(?:\s$pintag){0,1}>";
$phref = "href\s*=[\s'"]*([^\s'">]*)";

if ($title !== false)
$title = preg_match("/$ptitle/iX", $html, $title) ? $title[1] : '';

if ($text !== false)
{
$text = $html;

if ($start !== false && ($pos = strpos($text, $start)) !== false)
$text = substr($text, $pos+strlen($start));
if ($end !== false && ($pos = strpos($text, $end )) !== false)
$text = substr($text, 0, $pos);

$text = preg_replace("/$pexclude/iX", " ", $text);
$text = preg_replace("/<$pintag>/iX", " ", $text);
$text = preg_replace("/\s+|&nbsp;/iX", " ", $text);
}

if ($anchors !== false)
{
$html = preg_replace("/$pexclude/iX", " ", $html);

preg_match_all("/$panchor/iX", $html, $anchors);
$anchors = $anchors[0];

reset($anchors);
while (list($i, $x) = each($anchors))
$anchors[$i] = preg_match("/$phref/iX", $x, $x) ? $x[1] : '';

$anchors = array_unique($anchors);
}
}


// ----- URL Functions ---------------------------------------------------------


// ----- Parse URL -----

function url_parse($url)
{
$error_reporting = error_reporting(E_ERROR | E_PARSE);
$url = parse_url($url);
error_reporting($error_reporting);
return $url;
}

// ----- Extract Scheme -----

function url_scheme($url, $scheme = 'http')
{
if(!($url = url_parse($url))) return $scheme;
return isset($url['scheme']) ? $url['scheme'] : $scheme;
}

// ----- Extract Host -----

define('URL_HOST_DEFAULT', 0);
define('URL_HOST_APPEND', 1);
define('URL_HOST_STRIP', 2);

function url_host($url, $www = 0, $lower = true)
{
if(!($url = url_parse($url))) return '';
$url = $lower ? strtolower($url['host']) : $url['host'];
if ($www == URL_HOST_APPEND && strpos($url, 'www.') !== 0) return 'www.' . $url;
if ($www == URL_HOST_STRIP && strpos($url, 'www.') === 0) return substr($url, 4);
return $url;
}

// ----- Extract Path -----

function url_path($url)
{
if(!($url = url_parse($url))) return '';
$url = isset($url['path']) ? explode('/', $url['path']) : Array();
if (reset($url) === '') array_shift($url);
if (end ($url) === '' || strpos(end($url), '.') !== false) array_pop($url);
return implode('/', $url);
}

// ----- Extract Filename -----

function url_file($url, $convert = Array())
{
if(!($url = url_parse($url))) return '';
$url = isset($url['path']) ? end(explode('/', $url['path'])) : '';
$url = (strpos($url, '.') !== false) ? $url : '';
foreach ($convert as $i => $x) $url = preg_replace($i, $x, $url);
return $url;
}

// ----- Extract Extension -----

function url_ext($url, $convert = Array())
{
if(!($url = url_parse($url))) return '';
$url = isset($url['path']) ? end(explode('/', $url['path'])) : '';
$url = (strpos($url, '.') !== false) ? end(explode('.', $url)) : '';
foreach ($convert as $i => $x) $url = preg_replace($i, $x, $url);
return $url;
}

// ----- Extract Query -----

define('URL_QUERY_NOESCAPE', 0);
define('URL_QUERY_ESCAPE', 1);

function url_query($url, $escape = 0, $exclude = Array())
{
if(!($url = url_parse($url))) return '';
if (!isset($url['query'])) return '';
$url = preg_split('/(&(?!amp;)|&amp;)/', $url['query']);

foreach ($url as $i => $x)
{
$x = explode('=', $x);
if (in_array($x[0], $exclude)) unset($url[$i]);
}

return implode($escape ? '&amp;' : '&', $url);
}


[/code]
Copy linkTweet thisAlerts:
@solidaritiauthorJun 14.2006 — api.php continued

[code=php]
// ----- Concat -----

function url_concat($base, $rel)
{
$scheme = url_scheme($base);
$host = url_host ($base);
$path = url_path ($base);

if ($rel{0} == '/')
return "$scheme://$host$rel";
else if ($path === '')
return "$scheme://$host/$rel";
else return "$scheme://$host/$path/$rel";
}

// ----- Normalize -----

function url_normalize($url,
$scheme = 'http',
$www = 0,
$convert = Array(),
$escape = 0,
$exclude = Array())
{
$scheme = url_scheme($url, $scheme);
$host = url_host ($url, $www);
$path = url_path ($url);
$file = url_file ($url, $convert);
$query = url_query ($url, $escape, $exclude);

if ($scheme === '' || $host === '') return '';

if ($path === '')
return "$scheme://$host/$file" . ($query ? "?$query" : "");
else return "$scheme://$host/$path/$file" . ($query ? "?$query" : "");
}


// ----- Index Website ---------------------------------------------------------

define('INDEX_HOST_DEFAULT', 0);
define('INDEX_HOST_APPEND', 1);
define('INDEX_HOST_STRIP', 2);

function index($roots, &$urls, $max, $ext_parse, $www, $convert, $exclude,
&$titles, &$texts, $extensions, $start, $end)
{
$time = microtime(true);
$parsed = 0;

foreach ($urls as $i => $url)
$urls[$i] = url_normalize($url, 'http', $www, $convert, URL_QUERY_NOESCAPE, $exclude);

for ($ind = 0; isset($urls[$ind]); $ind++)
{
if (trim($urls[$ind]) === '')
{
unset($urls[$ind]);
continue;
}

// ----- Check URL -----

$in_root = false;
foreach ($roots as $i => $root)
$in_root = $in_root || strpos($urls[$ind], $root) === 0;

if (!$in_root)
{
if (!$ext_parse) continue;
if ($titles === false && $texts === false) continue;
}

if (!in_array(url_ext($urls[$ind]), $extensions)) continue;

// ----- Get Contents -----

$error_reporting = error_reporting(E_ERROR | E_PARSE);
$html = file_get_contents($urls[$ind]);
error_reporting($error_reporting);

if ($html === false)
{
unset($urls[$ind]);
continue;
}

// ----- Parse URL -----

$parsed++;

parse($html, $title = $titles !== false,
$text = $texts !== false,
$anchors, $start, $end);

if ($titles !== false) $titles[$ind] = $title;
if ($texts !== false) $texts [$ind] = $text;

// ----- Extract Anchors -----

if (!$in_root ||count($urls) > $max) continue;

foreach ($anchors as $i => $x)
{
$x = preg_replace("/#.*/X", "", $x);
if ($x == '' || preg_match("/^(\w)+:(?!//)/X", $x)) continue;
if (!preg_match("/^(\w)+:///X", $x)) $x = url_concat($urls[$ind], $x);
$x = url_normalize($x, 'http', $www, $convert, 0, $exclude);
if (!in_array($x, $urls) && (count($urls) < $max)) $urls[] = $x;
}
}

return Array("time" => microtime(true)-$time, "parsed" => $parsed);
}


// ----- Separate Links --------------------------------------------------------

function separate($roots, $urls,
&$int_pages, &$int_loads, &$ext_pages, &$ext_loads,
$extensions)
{
foreach ($urls as $i => $url)
{
if (trim($url) === '') continue;

$in_root = false;
foreach ($roots as $j => $root)
$in_root = $in_root || strpos($url, $root) === 0;

if ($in_root)
{
if (in_array(url_ext($url), $extensions))
$int_pages[$i] = $url;
else $int_loads[$i] = $url;
}
else
{
if (in_array(url_ext($url), $extensions))
$ext_pages[$i] = $url;
else $ext_loads[$i] = $url;
}
}
}


// ----- Debug Query -----------------------------------------------------------

function mysql_query_debug($str)
{
$result = mysql_query($str);

if (mysql_error())
echo "<hr /><b>Message:</b> " . mysql_error() . "<br /><b>Query:</b> $str<hr />";

return $result;
}


// ----- TMySQL_KeyVal ---------------------------------------------------------

class TMySQL_KeyVal
{
var $tbl = null;
var $prefix = null;

// ----- Init -----

function Init($tbl, $prefix)
{
$this->tbl = $tbl;
$this->prefix = $prefix;
}

// ----- CreateTable -----

function CreateTable($drop = false)
{
if ($drop) mysql_query_debug("drop table {$this->tbl}");

mysql_query_debug(
"create table {$this->tbl}
({$this->prefix}id integer unsigned not null unique auto_increment,
{$this->prefix}hash integer unsigned not null,
{$this->prefix}key varchar(255) not null unique,
{$this->prefix}val text not null,
{$this->prefix}weight integer unsigned not null,
index {$this->prefix}hash ({$this->prefix}hash),
primary key ({$this->prefix}id))");
}

// ----- Set -----

function Set($key, $val, $weight = false)
{
$hash = '0x' . substr(md5($key), 0, 8);
$key = mysql_real_escape_string($key);
$val = mysql_real_escape_string($val);

$result = mysql_query_debug(
"select * from {$this->tbl}
where {$this->prefix}hash = $hash &&
{$this->prefix}key = '$key'");

if (!mysql_num_rows($result))
{
mysql_query_debug(
"insert into {$this->tbl} ({$this->prefix}hash, {$this->prefix}key)
values ($hash, '$key')");

$result = mysql_query_debug(
"select * from {$this->tbl}
where {$this->prefix}hash = $hash &&
{$this->prefix}key = '$key'");
}

$id = mysql_fetch_assoc($result);
$id = $id["{$this->prefix}id"];

if ($weight === false)
{
mysql_query_debug("update {$this->tbl}
set {$this->prefix}val = '$val'
where {$this->prefix}id = $id");
return $id;
}

if ($weight === true)
{
mysql_query_debug("update {$this->tbl}
set {$this->prefix}val = '$val',
{$this->prefix}weight = {$this->prefix}weight+1
where {$this->prefix}id = $id");
return $id;
}

$weight = (integer)$weight;
mysql_query_debug("update {$this->tbl}
set {$this->prefix}val = '$val',
{$this->prefix}weight = $weight
where {$this->prefix}id = $id");
return $id;
}

// ----- Get -----

function Get($key)
{
$val = $this->GetByKey($key);
return $val ? $val['val'] : false;
}

// ----- GetById -----

function GetById($id)
{
$id = (integer)$id;

$result = mysql_query_debug(
"select {$this->prefix}id 'id',
{$this->prefix}key 'key',
{$this->prefix}val 'val',
{$this->prefix}weight 'weight'
from {$this->tbl} where {$this->prefix}id = $id");

return mysql_fetch_assoc($result);
}

// ----- GetByIds -----

function GetByIds($ids)
{
if (count($ids) == 0) return Array();

$ids = "(" . implode(",", $ids) . ")";

$result = mysql_query_debug(
"select {$this->prefix}id 'id',
{$this->prefix}key 'key',
{$this->prefix}val 'val',
{$this->prefix}weight 'weight'
from {$this->tbl} where {$this->prefix}id in $ids");

$data = Array();
while($row = mysql_fetch_assoc($result)) $data[$row['id']] = $row;
return $data;
}

// ----- GetByKey -----

function GetByKey($key)
{
$hash = '0x' . substr(md5($key), 0, 8);
$key = mysql_real_escape_string($key);

$result = mysql_query_debug(
"select {$this->prefix}id 'id',
{$this->prefix}key 'key',
{$this->prefix}val 'val',
{$this->prefix}weight 'weight'
from {$this->tbl}
where {$this->prefix}hash = $hash &&
{$this->prefix}key = '$key'");

return mysql_fetch_assoc($result);
}

[/code]
Copy linkTweet thisAlerts:
@solidaritiauthorJun 14.2006 — api continued:

[code=php]

// ----- GetAll -----

function GetAll()
{
$result = mysql_query_debug(
"select {$this->prefix}id 'id',
{$this->prefix}key 'key',
{$this->prefix}val 'val',
{$this->prefix}weight 'weight'
from {$this->tbl}
order by {$this->prefix}weight desc, {$this->prefix}id");

$data = Array();
while($row = mysql_fetch_assoc($result)) $data[$row['id']] = $row;
return $data;
}

// ----- Clear -----

function Clear($key)
{
$hash = '0x' . substr(md5($key), 0, 8);
$key = mysql_real_escape_string($key);

mysql_query_debug(
"delete from {$this->tbl}
where {$this->prefix}hash = $hash && {$this->prefix}key = '$key'");
}

// ----- Clear All -----

function ClearAll($key)
{
mysql_query_debug("delete from {$this->tbl}");
}
}


// ----- TMySQL_WordId ---------------------------------------------------------

class TMySQL_WordId
{
var $tbl = null;
var $prefix = null;

// ----- Init -----

function Init($tbl, $prefix)
{
$this->tbl = $tbl;
$this->prefix = $prefix;
}

// ----- CreateTable -----

function CreateTable($drop = false)
{
if ($drop) mysql_query_debug("drop table {$this->tbl}");

mysql_query_debug(
"create table {$this->tbl}
({$this->prefix}word varchar(255) not null,
{$this->prefix}id integer unsigned not null,
{$this->prefix}count integer unsigned not null,
unique index {$this->prefix}ind ({$this->prefix}word, {$this->prefix}id))");
}

// ----- Fill -----

function Fill($id, $word2count)
{
foreach ($word2count as $i => $x) $word2count[$i] = "("$i",$id,$x)";
$word2count = implode(",", $word2count);

mysql_query_debug("insert into {$this->tbl} values $word2count;");
}
}


// ----- Word forms ------------------------------------------------------------

function wordforms($words)
{
if (!$GLOBALS["src_word_forms"]) return $words;

$forms = Array();

foreach ($words as $i => $word)
{
$word = strtolower(trim($word));
$forms[] = $word;

if (preg_match("/^(.*([^aeiou]))$/", $word, $matches))
array_push($forms, "{$matches[1]}s",
"{$matches[1]}{$matches[2]}ed",
"{$matches[1]}{$matches[2]}ing");

if (preg_match("/^(.*)e$/", $word, $matches))
array_push($forms, "{$matches[1]}es", "{$matches[1]}ed", "{$matches[1]}ing");
}

return array_unique($forms);
}

// ----- Excerpt ---------------------------------------------------------------

function excerpt($words, $text, $maxlen)
{
$bolds = "([^a-zA-Z])(" . implode("|", $words) . ")([^a-zA-Z])";
$words = "[^a-zA-Z](?:" . implode("|", $words) . ")[^a-zA-Z]";
$parts = preg_split("/($words)/iX", " $text ", -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);

$start = 0;
$count = 0;

for ($i = 0; $i < count($parts); $i++)
{
$len = 0;
for ($j = $i; $j < count($parts); $j++)
{
$len += strlen($parts[$j]);
if ($len >= $maxlen) break;
}
if ($j-$i > $count)
{
$start = $i;
$count = $j-$i;
}
}

$result = '';
for ($i = $start; $i < $start+$count; $i++) $result .= $parts[$i];

if ($start-1 >= 0)
{
$part = preg_split("/([^a-z])/iX", $parts[$start-1], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
for ($i = count($part)-1; $i > count($part)-10 && $i >= 0; $i--) $result = $part[$i] . $result;
}

if ($start+$count < count($parts))
{
$part = preg_split("/([^a-z])/iX", $parts[$start+$count], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
for ($i = 0; $i < count($part) && $i <= 10; $i++) $result .= $part[$i];
}

return trim(preg_replace("/$bolds/iX", "$1<b>$2</b>$3", $result));
}

// ----- Parse Query -----------------------------------------------------------

function ParseQuery($str)
{
return preg_split("/[^a-z]+/", $str, -1, PREG_SPLIT_NO_EMPTY);
if (is_array($str)) return $str;
return ($str !== '') ? Array($str) : Array();
}

// ----- Search ----------------------------------------------------------------

function search($words, $allwords, $nowords, $offset, $limit, &$numrows)
{
$words = wordforms(array_merge($words, $allwords));
$count = count($allwords);
$somewords = wordforms($words);
$somewords[] = '-=-=-=-=-=-=-=-=-=-=';
$somewords = "('" . implode("','", $somewords) . "')";
$allwords [] = '-=-=-=-=-=-=-=-=-=-=';
$allwords = "('" . implode("','", $allwords ) . "')";
$nowords [] = '-=-=-=-=-=-=-=-=-=-=';
$nowords = "('" . implode("','", $nowords ) . "')";

$result = mysql_query_debug(
"select sql_calc_found_rows
urls_key, urls_val,
sum(index_count) word_weight,
sum(index_word in $somewords) somewords_count,
sum(index_word in $allwords) allwords_count,
sum(index_word in $nowords) nowords_count
from {$GLOBALS['src_index']->tbl},
{$GLOBALS['src_urls']->tbl}
where (index_word in $somewords ||
index_word in $allwords ||
index_word in $nowords
) && urls_id = index_id
group by index_id
having somewords_count > 0 &&
allwords_count = $count &&
nowords_count = 0
order by word_weight desc
limit $offset, $limit");

$numrows = mysql_query_debug("select found_rows() NN");
$numrows = mysql_fetch_assoc($numrows);
$numrows = $numrows["NN"];

$pages = Array();

while($page = mysql_fetch_assoc($result))
{
$url = $page['urls_key'];
$val = unserialize($page['urls_val']);
$title = $val['title'];
$text = $val['text' ];

$pages[] = Array("url" => $url,
"title" => $title,
"excerpt" => excerpt($words, $text, 100));
}

return $pages;
}

// ----- Display ---------------------------------------------------------------

function display($results, $words, $allwords, $nowords,
$offset, $limit, $numrows, $time,
$template_all, $template_ind, $template_cur, $template_ref, $template_non)
{
if ($numrows == 0)
{
echo $template_non;
return;
}

$ind = "";

for ($i = 0; $i < (integer)(($numrows+$limit-1)/$limit); $i++)
{
$trans = Array("%%page%%" => $i+1,
"%%offset%%" => $i*$limit,
"%%words%%" => urlencode($words),
"%%allwords%%" => urlencode($allwords),
"%%nowords%%" => urlencode($nowords));
if ($i*$limit == $offset)
$ind .= strtr($template_cur, $trans);
else $ind .= strtr($template_ind, $trans);
}


$ref = "";

foreach ($results as $i => $result)
{
$trans = Array("%%url%%" => $result["url"],
"%%title%%" => $result["title"],
"%%excerpt%%" => $result["excerpt"]);

$ref .= strtr($template_ref, $trans);
}

$trans = Array("%%ind%%" => $ind,
"%%ref%%" => $ref,
"%%numrows%%" => $numrows,
"%%time%%" => $time);
echo strtr($template_all, $trans);
}

?>
[/code]
Copy linkTweet thisAlerts:
@bokehJun 14.2006 — Why have you made everything so complicated? If you need more than 50 lines of code to do this you are making a meal out of it.
Copy linkTweet thisAlerts:
@solidaritiauthorJun 14.2006 — How would I only do this in 50 lines then??
Copy linkTweet thisAlerts:
@bokehJun 14.2006 — Well for a start you don't need a dynamic query. MySQL has its own search functions built in so why not take advantage. The best way is a FULLTEXT search. One simple query and then you hand things over to MySQL. It does its stuff and returns its output in relevance order.
Copy linkTweet thisAlerts:
@solidaritiauthorJun 14.2006 — That definatly makes more sense to me, however I have never heard of any of that, do you know of any good tutorials? Or resources, or could you run me trhough it?
Copy linkTweet thisAlerts:
@bokehJun 14.2006 — [URL=http://www.phpfreaks.com/tutorials/129/0.php]Have a look at this![/URL]
×

Success!

Help @solidariti spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...