Jump to content


This topic is now archived and is closed to further replies.


Flat file database

Recommended Posts

Hello evryone,
I have changed an existing Searchscript to a database script,
now i have come up with a prob.

i can make it pull strings from database, what i cannot is
to make it pulling strings w/o an function for each string to pull,
etc for pulling colors i have an function for color1 color2 color3

instead of a function for Color[i++]

the functions look like this:

function Color($Artikel) {
// $Artikel = trim((($Artikel)));
$search_data = @file($GLOBALS[index_file]) or die("<h4 align=\"center\">$GLOBALS[err_no_search_db]</h4>");
foreach ($search_data as $search_page) {
$page_arr = explode("|", $search_page);
$found_count = 0;
$qry_array = split('[, ]',trim(($Artikel)));
foreach ($qry_array as $qry) {
if (in_array($qry, $page_arr)) {
$pages_found .= $page_arr[4] . " ";
if ($found_count == count($qry_array)) $Color[] = $page_arr[4];
return $Color;

Needed for all functions are:

$Colour = Color($q);
foreach ($Colour as $Color);

I am stuck What to do,
full script available here:
[a href=\"http://www.interad.se:8090/DataBase/DataBase.rar\" target=\"_blank\"]http://www.interad.se:8090/DataBase/DataBase.rar[/a]
[a href=\"http://www.interad.se:8090/DataBase/DataBase.tar.gz\" target=\"_blank\"]http://www.interad.se:8090/DataBase/DataBase.tar.gz[/a]
seen in action here:
[a href=\"http://www.odiumclothing.net\" target=\"_blank\"]http://www.odiumclothing.net[/a]

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.