Jump to content

Flat file database


iesus

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)) {
++$found_count;
$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]
or:
[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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.