Creating A Simple Boolean Search
Im looking to create a very simple search for the website I'm working on.
I need it to search the table "products"
in the following fields: "prod_number" "name" "keywords"
I have been able to write a simple little script that processes the the form and sends it to "search.php" where it looks for the correct matches. The problem with the script is that it only finds exact matches ( this would work for the part number as there is only one per product) but if the user is searching for a keyword they will obviously not know the exact name of the product, thus it will not show.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Highlight Found Boolean Search Terms
I have a boolean search feature for my site. On the standard non-boolean search features I have highlighting of the found terms. I want to be able to highlight found terms of a boolean search. Is there a way to highlight found search terms for a boolean result set? OR Is there a way to explode the result string of the Select statement and pick out the words used by the embedded MySql boolean search engine? Code:
MySQL Boolean FullText Search Ordered By Relevance
Ok, hopefully someone can help me here! (sorry if some of my tech words are wrong!) I have a Mysql Boolean Full Text search on one of my sites which uses the following code:- $Query = "SELECT * from $TableName where match (data) against ('+keyword, +keyword1' IN BOOLEAN MODE)"; $Result = mysql_db_query ($DBName, $Query, $Link); while ($Row = mysql_fetch_array ($Result)){ echo etc etc Which works fine - the Data I require from the table is stored in the $Row Array and I can pull this data and write it to the document. However, I want to order the results by relevance so the code has been changed to:- $Query = "SELECT match (data) against ('keyword, keyword1') as Relevance from $TableName Where Match (data) against ('+keyword, +keyword1' IN BOOLEAN MODE) HAVING Relevance > 0.2 Order by Relevance Desc"; $Result = mysql_db_query ($DBName, $Query, $Link); while ($Row = mysql_fetch_array ($Result)){ echo etc etc Now though the $Row array contains the relevance score rather than the data from the table. :( Any ideas where the data from the table is now stored or where I have gone wrong?
Give User A Choice Of Fields To Search With Full Text/Boolean?
I want to give the user the option of searching a combination of the fields $Topic, $Subtopic, $Theswords in Boolean/Full Text. The problem is if I make any of the fields empty prior to the query, I get a MySql syntax error message. The user has the option of selecting fields via checkboxes, but when the field is not selected the user will get the error message because the variable is empty in the query statemtnt. Are there any code suggestions for avoiding the error message when a field is not selected by the user to be searched? Code:
Creating Simple Combo Box
Very new to PHP and would like to create a combo box in which: 1. I have set an intial value (e.g. "mollusca") and 2. the user has the capability of adding additional values to the list.
Creating Simple Unordered List Menu From XML?
Does anyone have any examples or links to examples of generating a simple unordered list menu with multiple levels from an XML file? We are redesigning the navigation on our website and I was hoping to make this as flexible as possible.
Simple Search
I 'm developing a site consisting of 5-10 html/php pages. I want to add a simple keyword search in my site. I can't seem to find any simple script, except risearch which can't search my Greek pages (el_GR.UTF-8).
Simple Search
Im trying to create a simlpe mysql database search. I have a database called "lever" and then a table called "faults" Inside the table i have the following titles: Incident School Person Summary I want a search field that uses the "incident" filed to display data only in that row. I would like it to be displayed on a html page. Is anyone able to help me with the code. Ive tried using some that have been suggested on the web but I cant seem to configure them correctly.
PHP And PostgreSQL - Simple Search
I just have a question about doing searches in the database. I'm sure it's really simple, but postgresql.org's documentation is really horrible (in my opinion). Anyway I just want to know how to make a simple search with php/sql. Just so people can enter a word or string and sql will select rows containing that text in a specified field.
Simple Search Engine
I need a simple search engine for my website. I have a lot of products, lets say 30. How can I make an as easy as possible search engine. Without the need of a mysql database. Presuming that I want to store the products information in only one file. Where do I start?
Simple Mysql Search?
how to search various items in a table (i.e. name, year, contact) by using only one search box? (with no drop-down menu) Also I want an index page where the user can click on A,B,C,D etc. and the search returns names beginning the letter.
Simple Php Search Engine
I was hoping one of you had come across a simple php search engine that was not database driven. Sasquatch2 would have been perfect except it doesn't have PDF support. Any ideas? I'm no PHP expert by any means but do you think it would be easy to add PDF support to Sasquatch2.
Simple Search Engine For Your Site?
If I have a simple products database such as: productID Shoe Size big Shoe Size med Shoe Size small Shoe Colour Shoe weight Shoe Price etc. etc. What's the best way to build your seach engine? Use checkboxes?? And have codes that will append to your SQL query? such as: if (!empty(shoe_size_big_checked)){ $query .= "AND shoe_size_big=yes";} The last search system I made was quite messy so I am wondering is there a systematic way of building a search system? That would create the appropriate SQL command depending on the user's input.
Simple Search Script It Not Working??
I really don't get this, I have a simple demo script setup to search two fields which then search a table. The table has two records, Record 1 = Field1 is Cep, Field2 is moo Record 2 = Field1 is Cepeleon, Field2 is moocow When the user enters Cep into field1's text box the sql runs, SELECT * FROM new WHERE field1 LIKE 'cep' However it returns 0 results saying that the query is empty? If I run this exact same query in PHPmyAdmin, I get the result. I don't get it? Code:
Creating A Search Function
I need to create a search function for a recruitment company website that allows the user to select from one drop down box whether the job is permanent, temporary or search all jobs and from that select the job category. i have tried looking for tutorials on the web but cant find anything. Would anyone be able to point me in the right direction to find a tutorial to help me complete this? it needs to work like the advanced search function on this webiste but only have the Job Type and Job Category search options: Code:
Creating An XML File From A PHP Search Engine
I've written a search algorithm that will be used on a fairly large (350 - 400 pages) site. I have decided to make the script output an xml file to which I will apply an xsl style sheet to format and display the results in html. My question is what is the best way to create the xml file using php? Are there any useful functions available specifically for this type of thing, I have searched the forums but found nothing of any use. The way I'm thinking is to create the xml file at the beginning of the search script, loop through searching the pages and building an xml fragment for each result, after the loop has exited the script will add the closing xml tag. I know that I can make the script work how I just described it but I would like to know if anyone has written anything like this before and whether there are any shortcuts or tips that anyone knows of.
Creating Search Engine In Php And Mysql
I want to create a search option for my site (ONLY searches my pages, NOT a web search). A lot like the one on these forums actually. I was just wondering if anybody who has done this before had any suggestions as to how I should go about doing it. Is it possible just using php and mysql... or would I need to use some other type of language (to make the spider). Or do I even NEED a spider for something like this? Here is how I think it could be done. I'd have 2 columns. One for the location of each page on the site. Another would have text from the page (perhaps the first 40 words on the page). From there, I could have my searching script compare the search value against anything the text column. if it found the search value in the text column it could display the link in the results page, with the text from the page to serve as a description.
Need Help Creating A File Search Online
I need to create a search that will search partial files names of images and display the images. Basically, I have a folder on the internet that has security camera images dumped into it with a file name like this: MDcameraname20050109104846001N38B.jpg MDcameranameYYYYMMDDHHMMSS001N38B So what I would like to create is a search that will allow a user to input the year, month, day, and hour, and have the website display the images from that hour.
Creating A Search Class That Searches Any Database
I've been requested by a client to implement a search engine on it's website. I told him that he does not need it, but he thundered on and well...Who cares, he' s gonna pay for it. I've made search methods for other sites, but I would like to implement a portable one. A Search Class that could work for any DataBase and with ease of configuration. Maybe de constructor could receive a database name in which to search. And the function search, could receive an array of tables in which to search on and a string to search for on those tables. The question is...how would u implement the way that the class returns results? Nowadays any pro site has the MVC controller. That means that almost all tables in the database have its corresponding model. Table clientes correspond to the Client Model. How would you implement the results return?
Boolean Operation
what is oposite of if ($_periode == NULL || $_periode == "") it is not if ($_periode != NULL || $_periode != "")
How To Do A Boolean Value In MySQL
What is the best way to store a boolean value in a MySql table (e.g. true or false) AND ( ;-) am I asking this in the right newsgroup (I could not find one for MySQL)
Mail Boolean
I have a email script that sends emails in a bcc: to many different recipients. the mail call is inclosed with in i an if statement like: if(mail("info@whatever.com", $email_subject, $email_body, $headers)) { $SUCCESS = TRUE; } else { $SUCCESS = FALSE;} Under what condition would false be returned by the mail function?
GD Functions - Creating A "Simple" Image
I want to create a "simple" square image at a variable height & width.. the image would be either transparent or perhaps use a background color.. And contain a "number" positioned in the top left corner maybe like: ----------------- - 1 - ----------------- Like I said "simple".. since I've yet to look into this, and I've yet to work with the gd library.. I'm wondering if someone can point me to some "examples".. Or perhaps, you already have a function to do just that.. I'm starting to work on a little calendar function, which I've written already.. I basically want to make it a little "schedular" app.. I want to create the image for an "onclick" event.. which opens a "view" of the selected day(s) event(s)... The image will give those (who use those "ancient" browsers) something to click on.. since some older browser do not support "onClick" event assigned to a table cell.
Simple Script For Doing A Simple Photo Album And Journal?
I'm looking to quickly get a photo album online. Very simple, thumbnails, a few pages, maybe a description, but hopefully a small script that's easy to edit and work into my existing site. I know about hot scripts, etc. but I was wondering if any one could recommend one? Secondly, I also want to setup a journal. It's not really a "blog" although I guess blog software may work. But it isn't going to be a message board or anything like that. Just a place to put out random bits of news. Once again, same premise, I'm trying to find the most simple script possible that could basically traverse a directory of simple textfiles and produce a list. I know all about Blosxom and stuff like that, but I'd like a script that just did the above and didn't overtake my site like PHPNuke or something like that. I'll probably roll my own, but I thought I'd check first.
Search Script Don't Search Empty Values
I'm trying to make a search script. I don't want the script to search for empty values if you don't write anything in one of the searchfields. Does anyone know how to do this, or where I can find examples of advanced searchscripts? Code:
Search DB Using Multiple Search Criteria On Web Form
I have a mysql database with a table with fields ( surname, company, speciality etc..) I created a simple form so people can search using criterias ( a search field which query all fields , a drop down with the list of surname, drop down with the list of speciality, drop down with a list of countries ). My system works perfectly well as long as I use only one criteria, However if I select "Plumber" as the speciality and "Scotland" as country, I will get all the entries for Scotland ( even if the speciality is not "plumber") and I will get all the entries for "Plumber" ( even if the coutry is not "Scotland"). Code:
Highlighting Of A Search Term In Search Results
I am writing this simple MySQL and PHP search and what I want to do is to highlight the search term in the results when they are displayed on the screen. I am able to get it to work. but the seach term will only be highlighted(Make it Bold) only if it matches exactly to what was typed in the search box. Is there a way where the search term doesn't have to exactly match in order for it to be highlighted? Below is the code where I change the the search term into bold to be displayed on the screen. <?php $result_manufact = str_replace($splitstr, "<span style="color: red; font-weight: bold;">$splitstr</span>", $manufact); ?>
Search Results ($num_rows) Does Not Match $search Results (PHP,MySQL)?
For example, when I do a database search for a term I get 2 results but the $num_rows says there are 3 results. I suspect it's because there are similar keywords within different search fields of the SQL statement. But I am stumped as to how I can change this. Any Suggestions? the code:
Simple Row
I have this code that doesn't work - all it does is display "5 products returned" i want it to display the 5 records that are in my database - can someone tell me what stupid thing i've done wrong? <?php $query="SELECT * FROM products"; $result = mysql_query($query); $num_results = mysql_num_rows($result); echo "<p>$num_results products returned</p>"; for ($i=0; $i <num_results; $i++) {$row = mysql_fetch_array($result); echo "<p><strong>".($i+1).". ID: "; echo $row["ID"]; echo "</strong><br>Product: "; echo $row["Product"]; echo "<br>Description: "; echo $row["Description"]; echo "<br>image: "; echo $row["Image"]; echo "<br>Cost: "; echo $row["Cost"]; echo "</p>"; }?>
What Is The Best Way To Use Simple Templates In PHP?
What is the best way to use simple templates in PHP? header, footer, etc, not parsing code 1.require 2.include 3.not using php but only HTML instead 4. Fast templates 5. other? where I can find a well explained tutorial on this?
Get Localhost - Very Simple
This is a very simple question I think, but I can't find a straight answer from the php documentation. What is the function or variable that I can use to get localhost information?
Simple Script
what i am doing is when a user goes to mysite and let's say that he is looking for a friend. Then he selects gender,country,age(selections). I have three categories to choose. Whatever a user select, the results comes from my database. If the results are 10 datas, it is 2pages. That's what I am trying to do but I got an error. PHP Code:
Simple Mark-up For CMS
I'm designing/coding a content management system in PHP and am currently considering how the users will add textual content. I would like them to be able to use some kind of simple mark-up, like a very limited subset of HTML, probably with a more friendly naming scheme. Does anybody have experience of such a thing? I'm thinking an XML application is the proper answer but when I consider the DTD and parser it seems like an overkill solution if I'm starting from scratch. Does anybody have any advice or suggestions on this? I'm sure it's been done before but I don't know where to look, is there something existing I can use or adapt? Has anybody tried this kind of thing before?
Simple Array
The code is making an array for one value and then plugging in the entire array into the SET part when it should only be one value. Here is the code, first part is the html form. PHP Code:
Simple URLs
I want to have a lot of control over my short urls. My site has guitar lessons and articles and I want to have short urls of the form: mysite.com/guitarlessons-scalelesson.html The original url is of the form: mysite/modules.php?op=modload&name=mainlessons&file=index&req=view_fulllesson&lessonid=8 In this case $lessonid 8 refers to scalelesson. All short URL examples I have seen take the original URL and directly translate it. In may case, the short URL scheme would have to query the database. I would like my forum to function similarly. That is, forum posts and forum pages would have forum category and post title in the short URL. Anyone know how to do advacned simple URLs of this sort? I really like how this forum does short urls actually. I can't imagine this is done with mod_rewrite() since the simple urls appear to be generated dynamically based on database calls.
Simple Redirect?
I've been searching through the forum, and the only solution offered for redirecting to another page seems to be this: header("Location: http://www.thispage.com "); Apparently, this doesn't work if it is not in the absolute beginning of the page. My question is the following: Isn't there a more simple command in PHP to tell this simple thing:"Go to this or that page now!".
Simple AJAX Example
Several times some members even me post for simple AJAX example with PHP. Some of experts will give URL of tutorial. Now with this attachment I send my simple test of AJAX +PHP with the help of w3schools. There is no alternative to study good tutorial but this simple example may give the fell of AJAX ...
Some Simple Security
I want to be able to add some simple security to one of my pages, basically my page allows users to submit a text field which gets parsed into MySQL db and displayed on other pages. At the moment anyone can submit text which opens the page to abuse. I don't want to implement a user login system. I had envisaged the addition of a password entry box which the Submit button checks against the db before proceeding, so if any user has the correct password then they can submit. Having never done password stuff before, could somebody please point me in the right direction? Also, if I have the config data to connect to the mysql db in a PHP file on my server, can anybody just open it?
Simple If Statement
How come this doesn't work? What am I doing wrong? $type = $_GET['functionType']; if ($type == 'Add'){ $AddSQL = "INSERT INTO..."; echo $AddSQL; }elseif ($type == 'Update'){ $UpdateSQL = "Update ..."; echo $UpdateSQL; }elseif ($type == 'Delete'){ $DelSQL = "DELETE FROM ..."; echo $DelSQL; }
Simple Opt-in Script?
I'm looking for a most simple but save opt-in mailing list script in php (linux Apache CGI, but shouldn't matter) best: * all in one single .php file; different functions by input vars / passwords; config vars on top of script * uses MySQL or a plain file (still no doubles) next to the .php (best both options) * double opt-in not necessary but nice * good would be "default topic" and at least up to 5 different lists/topic * takes directly my web forms like email=...&listname=...&sign=in ; repsonse page can be very simple. * I can read out the lists plain formatted also by web through the same ..php & password like: cmd=getlist&listname=...&password=... * hopefully no extreme installation tricks (thus php4, ..) looking at more than 10x google'd ones, always something was wrong, big or jerky or not as is should be...
Simple String
Heres my code: Its the result of a simple AJax login form. The problem I am having is with the & sign in the $page variable. Keeps coming up with the following error: "A semi colon character was expected. Error processing resource " Im sure I just need to escape the & sign but not sure how. Code:
Simple Parser In PHP?
I'm coming to the end of a large and exhausting project, done in my new favorite language PHP, and its time for a diversion. I'm wondering if anyone has experience with writing simple parsers. I've never done it myself, but I know they are not as mysterious as they may seem, it's a matter of finding the tools. The idea is to take something like CSS format, except that it allows nesting, and turn it into associative arrays, such as: anykey { property: value; property: value; nestedkey { property: value; property: value; } } could be processed by a command like: <?php $parsed = ParseMyFile(...) ?> and $parsed would hold the same as if we'd done this: $arr = array( anykey("property"=>"value",...
Simple Include
I have an include file called "my_inc_file.php" located in a subdirectly called "inc_files". I have a file both in my root directory, and in another subdirectory called "subdir", that uses the include file. My include is called in a template common to both, so has to have the exact same file structure. My local pc uses Windows, and my remote server uses Linux. How can I change my include statement so it works for both cases and both operating systems? include_once '/inc_files/my_inc_file.php'
Simple Counter
After a process opened, read and unlocked the counter.txt, some other process would open, read and even write its own count value. So the first process will write a count value less than the right value. And I guess it needs more exception handling codes. Code:
Simple Stuff
i am really getting confused with php's curly brackets ok how do i assign a variable and then assign a value to it from a form parameter send to it..like below if i dont add the @ then i get errors, so how do i assign a value to $actionvar, and if $actionvar is empty then condition ? If (@$actionvar =="") { echo ("<b><FONT COLOR=#804040>Rates in RM</b></font><br><br>");} else{ echo ("<b><FONT COLOR=#804040>Converted to $cname</b></font><br><br>");}?> when i doing somthing like this: <?php if ($wed =="") {$wed =="not selected"}?> it is giving me error in the last "}" why ?
Simple XML Parser
I am trying to write a simple XML parser with PHP. What would be the best way to assign the string/text stored in between <TAG> … and … </TAG> to a variable? The 'content' between the XML tags can have multiple lines and may contain other html tags.
|