#31
  1. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    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]
  2. #32
  3. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    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.
  4. #33
  5. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    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.
  6. #34
  7. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    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

  8. #35
  9. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    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 ?
  10. #36
  11. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    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
  12. #37
  13. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    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
  14. #38
  15. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    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 ...)
  16. #39
  17. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    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 ...)
  18. #40
  19. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    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?
  20. #41
  21. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    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
  22. #42
  23. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    rtyrt


    rtyrtyerer rtyrtytrry
  24. #43
  25. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    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.


  26. #44
  27. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    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
  28. #45
  29. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    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

IMN logo majestic logo threadwatch logo seochat tools logo