iesus Posted March 28, 2006 Share Posted March 28, 2006 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 isto make it pulling strings w/o an function for each string to pull,etc for pulling colors i have an function for color1 color2 color3instead 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 https://forums.phpfreaks.com/topic/6045-flat-file-database/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.