Development Articles
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDevelopment Articles

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #31  
Old November 10th, 1999, 01:35 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: taking input from a form field?

Hi,
<br>
Lets say you have a form :
<br>
[html code]
<br>
<form method="POST" action="showfield.php3"> <br>
<br>
<input type="text" name="T1" size="20"><br>
<br>
<input type="submit" value="Submit" name="B1"><br>
<br>
<input type="reset" value="Reset" name="B2"><br>
<br>
</form> <br>
<br>
[/html code]
<br>

<br>
If you need to print the input of your text box in your PHP script it would be like this :
<br>
[php code]
<br>
<?
<br>
print "This is the user input : $T1";
<br>
?>
<br>
[/php code]
<br>

<br>
You'll notice that 'T1' is the name of your text field. So to retreive info from a text field you have to use its name as a variable (in this case $T1).
<br>
Therefore, your search would look like this :
<br>

<br>
[php code once database is opened]
<br>
$query = "SELECT * FROM table WHERE field = $T1";
<br>
mysql_query($query);
<br>
[/php code]

Reply With Quote
  #32  
Old November 12th, 1999, 03:51 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Array of qids...

I don't really know much about writing search engines. As a matter of fact, I'm trying to write my first. I have to admit that this whole things has me pretty lost. I don't understand what the qid's are about and how to set them up. I don't understand how to search them efficiently and so, on, and so on.

I'm going to write the engine in php. I'm probably going to end up using mssql though I'm doing everything on mysql at the moment.

If someone could please take some time to explain at least the basics of all of this to me I would be greatly appreciative.

I'm not an idiot, I'm just not familiar with the methods of writing a fast, accurate search engine.

If it helps, I'll be searching a database of jobs by keywords, location, and field of interest, as well as company.

So, please on whatever information you can afford.

Thanks in advance for your help and your time.

Regards.

Reply With Quote
  #33  
Old November 12th, 1999, 04:08 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Array of qids...

I don't really know much about writing search engines. As a matter of fact, I'm trying to write my first. I have to admit that this whole things has me pretty lost. I don't understand what the qid's are about and how to set them up. I don't understand how to search them efficiently and so, on, and so on.

I'm going to write the engine in php. I'm probably going to end up using mssql though I'm doing everything on mysql at the moment.

If someone could please take some time to explain at least the basics of all of this to me I would be greatly appreciative.

I'm not an idiot, I'm just not familiar with the methods of writing a fast, accurate search engine.

If it helps, I'll be searching a database of jobs by keywords, location, and field of interest, as well as company.

So, please on whatever information you can afford.

Thanks in advance for your help and your time.

Regards.

Reply With Quote
  #34  
Old November 19th, 1999, 02:37 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
mysql.sock error

ok everyone, I just setup a linux server with mysql and using php also. The problem is that when going to the designated site I'm getting some errors and following all of the correct instructions I still get it. The main error I'm concerned with is the mysql.sock error in which there is no /var/lib/mysql dir created or no mysql.sock file in it. If you all want to take a look the site is at http://lfcc.exedor.net/~mjenkins/getstndinfo.php3 Please feel free to give me comments, suggestions and also please email me instead of respond to this because I rarely check these news groups out. Thanks


Reply With Quote
  #35  
Old November 29th, 1999, 10:37 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Execution error

Hello,


I've implemented this search engine in my website, but when I start the search, I receive following error :

Fatal error: Maximum execution time of 30 seconds exceeded

What can I do about this ?

Reply With Quote
  #36  
Old November 29th, 1999, 05:30 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
AND search?!?!?

I've applied the information in this article to develop a small (~80,000 sites for now) web search engine (using Perl to talk to MySQL, rather than PHP... personal preference.) I've implemented indexing, user-selectable result count/page, next/previous results, etc., and it's fast.

However, since I'm not really an SQL guy yet, I've run into a brick wall. It seems that the search produced by the example code is an "OR" seach, that is, searching for:
"fire insurance," will get me documents dealing with "fire bombs" "fire crackers" and "insurance fraud," but rarely "fire insurance." In other words: the "AltaVista Syndrome" - thousands of useless results.
What I really need to get my head around is how to perform an "AND" search- That is, only documents which contain ALL of the given keywords are returned. Any ideas?

Has anyone done an AND search based on this example, and more importantly would they want to give me a hint or two? I've read through tons of SQL stuff on the web and I still cannot formulate a solution...

thanks in advance...
PM

Reply With Quote
  #37  
Old December 12th, 1999, 01:36 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Performance problem - and solution

Stefan,
<br>
<br>
I wish to take the same approach as you to speed up my search engine but would like to know if you had to resort to a binary sort to decode your reference list. I want to use a bubble sort but dont know if it will be quicker than an sql query on a separate table as my database is not that big yet.
<br>
<br>
<br>
Thanks In advance
<br>
<br>
glenn

Reply With Quote
  #38  
Old December 12th, 1999, 07:44 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Performance problem - and solution

I've found it's better to build an temurary table to sort the result set. But the main problem is how to build this table because select into or insert sets are much too slow. so i decided to do this by writing a temorary file and load this file by "load file".

while developing such a search engine it's the best way to enable debug-routines where you can see how long each Action lasts. So you can decide where to optimize the code. (it's best to do this test on a really slow machine ...)

Reply With Quote
  #39  
Old December 12th, 1999, 07:55 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Performance problem - and solution

I've found it's better to build an temurary table to sort the result set. But the main problem is how to build this table because select into or insert sets are much too slow. so i decided to do this by writing a temorary file and load this file by "load file".

while developing such a search engine it's the best way to enable debug-routines where you can see how long each Action lasts. So you can decide where to optimize the code. (it's best to do this test on a really slow machine ...)

Reply With Quote
  #40  
Old December 16th, 1999, 11:36 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
How to do this with double-byte characters?

I want to make a chinese search engine with this indexing method.

Since chinese words do not use space to separate each word, can anyone tell me how to write the code so that it knows if it is a chinese word or other double byte words?

Reply With Quote
  #41  
Old December 17th, 1999, 07:04 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: AND search?!?!?

Did you try a sql-statement with a join?
something like this might work:
select * from words as table1,words as table2 where table1.Id=table2.id and table1.word="word1" and table2.word="word2".
good chance
philipp

Reply With Quote
  #42  
Old December 27th, 1999, 05:17 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
rtyrt

rtyrtyerer rtyrtytrry

Reply With Quote
  #43  
Old December 30th, 1999, 02:25 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
variable passing

I'm trying to pass the title of a document I've found using the search engine described above, using this code:

PRINT "$cnote. <a href=yourcontent.php3?count=$count&title=$title>

"$count" returns an integer value, as it should, i.e, the hyperlink will show:

http://myserver.org/subdir/yourcontent.php3?count=3$title=

As you can see, the title variable is empty; nevertheless, if I do an echo $title;, the appropriate title does appear, so I know $title is not an empty variable...

Any clues on how to fix this? Thanks.



Reply With Quote
  #44  
Old January 15th, 2000, 06:44 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
How to break sentences into words (arrays)

I have a variable that receives its information from a form. This variable will be a sentence entered by the user. What I need to do is break the sentence into individual words (possibly using an array). My suggestion was to put convert the string into an array, each column containing one word (since all words will be separated by spaces), that way I can use each column in the array as a separate word. If anyone knows how to create an array from a string and also how to access each column/element of this array, please let me know.
<br>
<br>
Thank-you

Reply With Quote
  #45  
Old January 15th, 2000, 06:44 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
How to break sentences into words

I have a variable that receives its information from a form. This variable will be a sentence entered by the user. What I need to do is break the sentence into individual words (possibly using an array). My suggestion was to put convert the string into an array, each column containing one word (since all words will be separated by spaces), that way I can use each column in the array as a separate word. If anyone knows how to create an array from a string and also how to access each column/element of this array, please let me know.
<br>
<br>
Thank-you

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherDevelopment Articles > Quick and Dirty Search Engine with PHP and MySQL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by