Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MySQL


Advertisements:




SuperbHosting.net & Arvixe.com have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for BigResource.com.







Php - Pagination Error 'Undefined Index: Search In C:wampwwwI-Document Ew.php On Line 8"


Im trying to do pages for my search result. My Search function is working fine. However, when I click on the page number. This error appears (below) :

Notice: Undefined index: search in C:wampwwwI-Document ew.php on line 8 ERROR: Select from dropdown This message only should appear when there is no input in dropdown and no search input. Im not sure how to correct this.

<?php
//connecting to the database
include 'config.php';
$search = mysql_escape_string($_POST['search']);
$dropdown = mysql_escape_string($_POST['dropdown']);
if (empty($search) && empty($dropdown)) {
die("Please choose your Search Criteria");
}
//max displayed per page
$per_page = 10;
//get start variable
$start = $_GET['start'];
//count records
$record_count = mysql_query("SELECT COUNT(*) FROM document WHERE $dropdown LIKE '%$search%'");
//count max pages
$max_pages = $record_count / $per_page;
if (!$start)
$start = 0;
//display data
$query = mysql_query("SELECT *.........................


View 4 Replies (Posted: Nov 15 10 at 2:12)

Sponsored Links:

Related Forum Messages for MySQL:
Undefined Index In Line Of Php Code?
$username = $_POST["user_name"];
$password = $_POST["user_password"];
$type = $_POST["user_type"];
$query = "SELECT * FROM users WHERE user_name='$username' AND user_password='$password' AND
user_type='$type'";

When run, I get an error message that states that the first three lines of code have undefined indexes. what went wrong here and how to fix it?

Posted: Apr 28 at 4:58

View 3 Replies!   View Related
Php - Undefined Index: FonctionCb In C:wampwwwProjet Compte Utilisateurmanip_liste.php On Line 7
1. I have a problem with the value of the checkbox

2. I have a problem with the mysql_fetch_array($variable, ASSOC); method --> all the data from my database are VARCHAR type

1. All the variable with, at the end 'Cb', signified that this value is from a checkbox of a FORM. If a checkbox is checked, it means that the row (ex: Username) will be in the Select method for my Database (ex: SELECT Username FROM...)

I receive this Error

1. Undefined index: fonctionCb in C:wampwwwProjet Compte Utilisateurmanip_liste.php on line 7

2. Undefined variable: tab in C:wampwwwProjet Compte Utilisateurmanip_liste.php on line 14 ...etc from all the checkbox if they are not checked .. here is my PHP code

<?php
$prep = "";
if(!$_POST['username'])
echo 'Nom d'utilisateur manquant';
if(($_POST["userCb"]) && ($_POST["suffixeCb"]) && ($_POST["fonctionCb"]) && ($_POST["passwordCb"])){
$prep = " * ";...............

Posted: Feb 24 at 0:37

View 3 Replies!   View Related
Notice Errors: Undefined Index, Username In C:member.php On Line 8Notice?
Im currently doing a tutorial on php and mysql and the project at the moment is to build a bookmark system.everything works fine, you can create the users, log the bookmarks, delete ect.but on the member.php page i get the following:Notice: Undefined index: username in C:member.php on line 8Notice: Undefined index: passwd in C:member.php on line 9in member.php there is the following code:

line 7: //create short variable names
line 8: $username = $_POST['username'];
line 9: $passwd = $_POST['passwd'];

both username and passwd are set up in the user table.my php.ini file has the following settings:error_reporting = E_ALL | E_STRICTdisplay_errors = offlog_errors = ontrack_errors = off

Posted: September 02, 2009 03:57AM

View 3 Replies!   View Related
Php - Error: Call To Undefined Function Db_connect() In Connection.php On Line X
When I call this command:

php.exe Connection.php

I get this error:

Fatal error: Call to undefined function ...mysql_connect() in Connection.php on line x.

But if I run it in my browser on the same server I have no problem And yes, mysql is enabled on my server

[EDIT]
Complete error:
"C:Program Files (x86)EasyPHP-5.3.6.0phpphp.exe" "C:Program Files (x86)EasyPHP-5.3.6.0wwwMusicSitePhpDevtronExemplesNewsTable.php"
Fatal error: Call to undefined function DevtronDatabasemysql_connect() in C:Program Files (x86)EasyPHP-5.3.6.0wwwMusicSitePhpDevtronDatabaseConnection.php on line 108

Posted: Apr 17 at 16:56

View 2 Replies!   View Related
Error: Call To Undefined Function Mssql_connect() In Script On Line 20
I am trying to make an array of customers by using a select statement in php but can't connect to the database. I get this error: Call to undefined function mssql_connect() in script on line 20.

[code]...

Posted: Apr 22 at 8:31

View 3 Replies!   View Related
Fatal Error: Call To Undefined Function Mysqli_connect() In C:wampwwwconnectindex.php On Line 2
I have windows 7 and I've installed wamp server 2.0i and verified mysql is running - I've created the jokes database from the book.

I installed netbeans ide 6.8 to do the html/php coding and it says it includes mysql support. When I display the php extensions in the WAMP server there is a checkbox next to php_mysqli (and php_mysql)

However when I use the following code from the book (page 118):

<?php
$link = mysqli_connect('localhost', 'root', 'password');

netbeans doesn't pop up with an auto-complete for the function and I receive the following error in my browser: Fatal error: Call to undefined function mysqli_connect() in C:wampwwwconnectindex.php on line 2

Posted: Jun 14, 2010, 13:03

View 2 Replies!   View Related
Undefined Index Error
I keep getting the error "undefined index:" and then it gives me the name of every variable on the page.

I could not find this type of error in the manual (ok I browsed/scanned the manual).

all of my php pages define or use the variable names exactly as on this page, but only these errors come up here. Here is my code:

Posted: May 01, 2007 07:17PM

View 1 Replies!   View Related
Php - Why It Always Say: Undefined Index: User
It always says the same error even I defined the user variable. I used this so that it can print the user name of the user and other details of the user who logged in a restricted page. Code when logging in:

<?php require_once('../Connections/Intranet.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
....
}
mysql_select_db($database_Intranet, $Intranet);
$query_Recordset1 = "SELECT * FROM useraccounts";
$Recordset1 = mysql_query($query_Recordset1, $Intranet) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?><?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {......................

Posted: Feb 10 at 2:50

View 4 Replies!   View Related
Getting The Undefined Index Error?
I have a checkbox which can make a post password protected-

<p><strong><label for="password">Password protect?</label></strong> <input type="checkbox" name="password" id="password" value="1" /></p>

I get the undefined index error.Now, if I try to check first if the password was set, I get the same error executing-

$sql = "INSERT INTO blog (timestamp,title,entry,password) VALUES ('$timestamp','$title','$entry','$password')";
$result = mysql_query($sql) or print("Can't insert into table blog.<br />" . $sql . "<br />" . mysql_error());

How do I fix it? Do I have to do it for every field like title text box and all?

Posted: Jan 31 10 at 18:42

View 4 Replies!   View Related
Fatal Error: Call To Undefined Function Mysql_connect() In D:web Sitemysql-php-test.php On Line 2
I ran MySql.PHP through my site and web browser and get this >"Fatal error: Call to undefined function mysql_connect() in D:web sitemysql-php-test.php on line 2"

I have no idea what I am really doing. Here's the code for the file.

<?php
$link = mysql_connect('localhost', 'username', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>

I of course change the username and password to the user and password for my database. The database is on port 3306. What am I doing wrong?

Posted: Jan 20 at 23:53

View 1 Replies!   View Related
PHP Form Checkbox And Undefined Index?
I am getting an "Undefined index" error when submitting a form with an un-checked checkbox. Is there any other way besides running an "isset" or "empty" check on each individual posted value? I have looked at this Question and am having trouble believing that this is the only solution.

Below is some example code:

EDIT: not that these are not the actual names of the tables columns; they are named uniquely (like "postAddress, displayPhone, student, etc.)

Posted: Apr 14 09 at 5:00

View 3 Replies!   View Related
Inverted Search Phrases Per Document?
I have a database full of phrases (80-100 characters), and some longish documents (50-100Kb), and I would like a ranked list of phrases for a given document; rather than the usual output of a search engine, list of documents for a given phrase.

I've used MYSQL fulltext indexing before, and looked into lucene, but never used it.
They both seem geared to compare the short (search term), with the long (document).

How would you get the inverse of this?

Posted: Dec 31 09 at 17:37

View 4 Replies!   View Related
PhpMyAdmin - Notice: Undefined Index: Type In...
The following error has appeared recently when I look at tables in phpMyAdmin, I can't find any useful information on the web about it though.

Error:

Notice: Undefined index: Type in D:******mysqlAdmin bl_properties_table_info.ph p on line 24

Posted: July 15th, 2008, 09:49 AM

View 8 Replies!   View Related
Php - Loop Through $_POST / Undefined Index Submit
I have a for loop which actually displays a product name and several buttons like: Edit, Update , Cancel
For each product i am displaying , it will have its own set of Edir, Update, and Cancel button as below.

Paint Edit Update Cancel

I want to loop through the buttons so that for each category, I can perform a different action. I was thinking about using something like btn_edit1, btn_edit2 for the name of the button and use a for loop. 1, 2 are the category ids.

for($i = 0; $i<count($obj_categories_admin->categories);$i++)
{
echo "<tr>";
echo "<td width='1500'>";
echo "<input type='text' name='name' size = '30' value='" . $obj_categories_admin->categories[$i]['name'] . "'/>";

[code]...

Now in my class, i have:

$a1 = $_POST['submit'];
$which_action = reset(array_keys($a1));
$which_category = reset(array_keys($a1[$which_action]));

But, i am getting the error : undefined index submit

Posted: Feb 11 10 at 15:53

View 2 Replies!   View Related
Undefined Index - Variable Or Ideal Error
I get Undefined index: variable or idea1 error when I come to the "simple page" by clicking on a common id on the "idea page". What's causing it is the $idea = addslashes($_POST['idea1']);-->I'm refering on the "simple page" here. But When I submit the data to the "simple page" again the Undefined index:variable error goes off the screen. Here is the "simple page":

[Code....]

Posted: January 19, 2009, 11:28:26 AM

View 10 Replies!   View Related
Php -Create Sequential Document Editing System (Only One Person Can Edit A Document At A Time)?
I'm in the process of creating a system that allows any logged in user to edit a single document, but I don't want more than one user to be able to edit that document at the same time.

(Just for reference, I plan to have an indefinite number of these documents on my website, and users can create new documents. Essentially, imagine Google Docs, but with only one user being able to edit a document at a time).

I currently have a JavaScript/AJAX/PHP solution that involves, for each document, a database-stored variable that holds the user id of the user who is currently editing that document. No other users can edit the document until that user is done, and the document

When a user is "done" editing (which means that they either closed the editing window or saved their changes), the document becomes available to any other user once again...or at least should in theory. For the app I'm developing, it's important that the document becomes available as soon as possible. That's not a problem if an editing user saves his or her changes, but is a problem if a user closes the editing window and doesn't save any changes.

My current setup, to account for the non-save case, is to do a periodic AJAX call, to a php page that essentially says, "I'm still editing. Give me two more minutes of editing time." So then, if the user closes the page, the document will become available to everyone within two minutes. That's too long for what I need though. I'd really like to make this as close to real time as possible (though a < 10 second delay wouldn't be awful).

These documents are publicly visible, and their statuses are displayed in list form. When a user loads the "view available documents" page, I need to do a query to check the state of all recent documents that should be shown, making documents with expired editing times available, and displaying them with the currently available ones.

Posted: Dec 10 10 at 4:33

View 2 Replies!   View Related
PHP / Java Bridge Fatal Error: Call To Undefined Function Mysqli_connect() In C:Program Filesapache-tomcat-6.0.26webappsJavaBridgexxxxxxxxx.php On Line 534
I am using Tomcat 6. I am running a php script using the JavaBridge. I get the following error when I run my code. Fatal error: Call to undefined function mysqli_connect() in C:Program Filesapache-tomcat-6.0.26webappsJavaBridgexxxxxxxxx.php on line 534

Posted: Apr 27 10 at 4:45

View 2 Replies!   View Related
Php - Comparing Database Values And Text Input Using Db And JQuery - Undefined Index And Mysql_fetch_assoc() Errors
I am having an issue with comparing text input with the values I have stored in a local database.

When I type in text into the text input field with id of #searchBar I get this error:

Notice: Undefined index: searchBit in C:wampwwwlifesearch equiressearch.php on line 6

I have tried for a while now to fix this problem without any real success. I don't understand why it says that the index is undefined.

If anyone could offer a possible solution I would greatly appreciate it.

Here's the code:

search.js

function search(searchQuery) {
$.post("requires/search.php", {searchBit:searchQuery}, function(data) {
$("#searchResults").html(data);
});
}
$(document).ready(function() {
$("#searchBar").focus(function() {
if ($("#searchBar").val() == "start searching...") {.........

Posted: Feb 12 at 4:28

View 1 Replies!   View Related
Database - Common Design Of Row Number/index/offset For Pagination?
My challenge is that I have a table of e.g. posts in a forum and I want to get the offset for LIMIT clause right. To illustrate the example: Table Post - remember OFFSET is the number/index of the row.

OFFSET 0: ID = 17, AUTHOR = ABC, CREATE_DATE = 2011-05-01
OFFSET 1: ID = 39, AUTHOR = ABC, CREATE_DATE = 2011-05-02
OFFSET 2: ID = 77, AUTHOR = ABC, CREATE_DATE = 2011-05-03
OFFSET 3: ID = 78, AUTHOR = ABC, CREATE_DATE = 2011-05-04
OFFSET 4: ID = 99, AUTHOR = ABC, CREATE_DATE = 2011-05-05
OFFSET 5: ID = 33, AUTHOR = ABC, CREATE_DATE = 2011-05-06
OFFSET 6: ID = 45, AUTHOR = ABC, CREATE_DATE = 2011-05-07
OFFSET 7: ID = 11, AUTHOR = ABC, CREATE_DATE = 2011-05-08
OFFSET 8: ID = 13, AUTHOR = ABC, CREATE_DATE = 2011-05-09
OFFSET 9: ID = 88, AUTHOR = ABC, CREATE_DATE = 2011-05-10

Now I want to make query for ID = 45, and my pagination should give a result of 5 entries per page. SELECT Table.* FROM Table WHERE Table.id = 45 ORDER BY Table.create_date; Result is one row with ID = 45. And then I want to know that the offset is 6 in relation to the 10 entries in total in the table. I want 5 rows per page, so x = 5 for the following statement. In other words I know the the row with offset = 6 is on the 2nd page of the results page with 5 entries per page.

SELECT Table.* FROM Table LIMIT x, 5
How do I know x?

My first idea is that I fetch all IDs from the table and just look for the right ID and then divide the offset by 5. Question: Is there a better way to do this in SQL because to me this seems like a very common challenge? Bonus question: SQL solution is fine; how to do it in MySQL specifically if there is a difference?

Posted: May 14 at 13:05

View 1 Replies!   View Related
Pagination For PHP Search Results?
How can i format pages in following manner? eg my search results gave me data for 50 pages. then i want this format for pages.

page1 page2 page3 page4 page5 .... page50

also when i click on '....' the result should be returned from page6 and the page listing should be like

page1 .... page5 page6 page7 page8 page9 .... page50

Posted: Nov 22 10 at 9:36

View 3 Replies!   View Related
Search Queries And Pagination With Php Or Javascript?
Im developing a site where its users can search for other users on the same website.

The queries can be very long and complex, so i would like to save some of the work done, so i dont have to repeat the same work again.

I was thinking i could save the results in a table, so when i use pagination it woudnt have to do the same query all over again, it could just get the results from the result table. How does this sound?

Maybe there is another better way? Is it possible to save queries in php sessions? Is this a good idea? Also im not sure what kind of pagination i should make, the one that goes like , prev , 1 , 2, 3 ,4 , next, or the "facebook style" where u just add 20 more results to the page every time scroller hits 10% of bottom window.

Posted: Apr 13 at 13:58

View 3 Replies!   View Related
Perl - Implementing DB Search Results Pagination?
I run a MySQL, CGI/Perl site. May be a 1000 hits a day. A user can search the database for the website. The where clause can become quite lengthy. I display 10 items per page and give the user links to go to the next and previous pages. Currently, I do a new search, every time the user clicks on 'prev' or 'next' page link. I use

LIMIT num-rows-to-fetch OFFSET num-rows-to-skip

along with the query statement. However, response time is way too much for subsequent searches. This can only get worse as I add more users. I am trying to see if I can implement this in a better way.

Posted: Feb 21 at 15:04

View 3 Replies!   View Related
Search Result Pagination COUNT & LIMIT
What is the best way to search a database and divide the output into pages. In the query I can use LIMIT, but then I dont get the number of total maches (??), which I would need for pagination purpose. If I dont use LIMIT I get all matches but only want to show 10 at a time. So basically the question is if LIMIT can involve COUNT or if I really need 2 queries for every search request, which of course will search the database twice.

1) COUNT the matches (full search of every record with WHERE clause)
2) do it again and LIMIT the matches (full search of limited record with WHERE clause)

Alternatively I thought about doing a serach only once without LIMIT or COUNT, and have e.g. PHP handle the limut/paging stuff. So what is best, resource-friendly practice?

Posted: February 14th, 2011, 06:01 AM

View 1 Replies!   View Related
Create Pagination For Search Results Using Db And ColdFusion
I'm trying to create pagination for search results using MySQL and ColdFusion. My intention is to only retrieve the queries that can be displayed on a single page, thus making the process efficient. I tried using two queries in my function, but I could not return two variables to the cfinvoke.

The following code does not paginate, but it displays the result search results using a CFC:

<!---DEFINE DEFAULT STATE--->
<cfparam name="variables.searchResponse" default="">
<cfparam name="URL.titleName" default="">
<cfparam name="URL.genreID" default="">
<cfparam name="URL.platformID" default="">.........

Posted: Jan 17 at 10:29

View 4 Replies!   View Related
Pagination W/ Query Data In Url For Initial Search Submission Not Holding?
How can I get the paramaters passed to the url on the first submission?

All subsequent pagination requests (such as when I hit Next>>) display the proper url parameters like (/35/0/...):
.../Plans/search/35/0/0/0/97378/page:2

But on the first search results page, the parameters are not passed (but the results are correct), so the url looks like this:

.../Plans/search/

So when I try to do a sort on the first page:

<?php $this->Paginator->sort('Sort by Monthly Cost','monthly_cost');?>

The results are cleared because no parameters are present. But every subsequent page (starting at page:2) the sort works fine because the params are in the url. I need to know how to pass the params to the url on the initial search.

I've been trying variations of this in the view:

$this->Paginator->options(array('url' => $this->passedArgs));

But I can't get them to pass..

Posted: Feb 15 at 19:39

View 1 Replies!   View Related
Pass Multiple Search Parameters A User Enters Through The Query String When Generating Pagination Links Using PHP?
How can you pass multiple search parameters a user enters through the query string when generating pagination links using PHP & MySQL?

Here is the HTML form.

<form action="search.php" method="post">
<input type="text" name="search" />
<input type="submit" name="submit" value="Search" />
</form>

Posted: Jul 21 10 at 13:41

View 1 Replies!   View Related
Php - Data Pagination With "saved" Search?
I'm creating a page that's a search result...When you're viewing one of the results, at the bottom of the page, I need to insert "Next result" and "Previous result" links, like a pagination... But from [I think] a saved search, right?Obs.: I'll use CakePHP (PHP) and MySQLpdate:The problem is not how to paginate the search results like "20 results per page"... I need to jump from one record to another, sequentally in the same search result.Let's say that I found the records 3, 5, 8 and 9 with my search... Then I click to view the #5 record and I can click on the "next result" link to jump to #8 record.

Posted: Apr 26 10 at 11:44

View 2 Replies!   View Related
Error - Supplied Argument Is Not A Valid Db Result Resource In /web_directory/index.php On Line 33
Im getting an error on my site that appeared for the first time today, despite functioning fine for months.

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /web_directory/index.php on line 33

Here is the code from those lines.

<? $sql = "SELECT
p.id as 'id',
p.post_title as 'client',
(SELECT `meta_value` FROM `wp_postmeta` WHERE `post_id` = p.id AND `meta_key` = 'thumb1') as 'thumb'
FROM.......

Posted: Aug 21 10 at 23:02

View 2 Replies!   View Related
Jquery - Search And Replace Each Line
I have a field within a table that I need to do a search and replace on, though it's a bit tricky and beyond my measure of querying skills. Basically, the contents of a field may look like this:

image1.jpg
image2.jpg
image3.jpg
image4.jpg
image5.jpg

I need to do a search and replace that would replace each line with something like:

<img src= [URL] />
<img src=[URL] />
<img src=[URL] />
<img src=[URL] />
<img src=[URL] />

The image titles are completely random and could be .gif, .jpg or pngs. The table name is "exp_channel_data" and the field name is "field_id_8" and I'd be running the query in phpadmin. Is the above search and replace possible?

Posted: Aug 2 10 at 14:41

View 3 Replies!   View Related
Show And Search For Hidden Characters (line Feeds, Etc) In Db?
I have a large MySQL database with lots of text (like '[new line]Normal') that I want to find & replace. However, I can't find it with any of the following searches, because I'm not sure what characters are used where the [new line] occurs - hence my question.

SELECT * FROM table WHERE field LIKE "%<!--[if gte mso 9]><xml>
Normal%";
SELECT * FROM table WHERE field LIKE "%<!--[if gte mso 9]><xml>
Normal%";
SELECT * FROM table WHERE field LIKE "%<!--[if gte mso 9]><xml>
Normal%";
SELECT * FROM table WHERE field LIKE "%<!--[if gte mso 9]><xml>
Normal%";

Posted: Oct 26 09 at 10:39

View 3 Replies!   View Related
Search Index
I have text stored in a database that I'd like to be searchable. However, searching through long strings and blobs seem like a very inefficient way of doing things.

In MS Server there's an index server that will take all strings and create indexes out of words. This can significantly speed up text searches.

Is there such a feature or tool for MySQL?

Posted: Nov 14, 2006, 21:01

View 1 Replies!   View Related
Db Search And Index Performance?
Imagine you have a blog post that users can subscrive to comments Is is faster to search on a table dedicated to manage subscriptions like: ID, Post, User

or is it faster to have a field in the users table with their subcritions:
Subscriptions=|2|4|18|21|33|

or is it faster to have a field in the post table with the users that subscrive to that post:
Users_subscrive=|1|2|4|6|9|

Posted: Feb 17 at 16:16

View 2 Replies!   View Related
Fulltext Index Search Problem
I have a MyISAM table "movies" with a fulltext index on the title column.

In there, I have among many other titles:

"City Of God"
"An Unreasonable Man"

I do a query like:
select title from movies where match (movies.title) against ('city god' in boolean mode);

I have two problems (thusfar :-)

(1) .... against ('+city of*') NEVER RETURNS - it results in a locked table and a bogged down mysql, even ^C out of the commandline client does not make the query go away (the table has less than 300 entries at this point, it's not big!).

('+city of') or ('+city') returns the right thing, and to tell the truth, the '+city of*' was an accident, but still, why does it lock up mysql?

(2) ....against ('man' in boolean mode) returns NOTHING.

('man unreasonable') or ('unreasonable') returns "An Unreasonable Man"

"man" is not listed as a stopword, so why does it not return a result??

Posted: June 07, 2007 11:18PM

View 2 Replies!   View Related
Search Engine, Fulltext Index
I'm going to develop a search engine that will crawl a number of sites. The database will be the latest stable release of MySQL. I've been reading everything I could get a hold of about MySQL fulltext searches, and it seems to be really sweet. I'd really like to use the boolean mode, but what I've read, the relevance score you get from boolean mode isn't as accurate as the relevance score in "normal" mode. I read on MySQL's website, that you could use boolean mode for the search, and "normal" mode for the relevance score, like this:
SELECT
*,
MATCH(post_content, post_title) AGAINST('string') AS `score`
FROM
posts
MATCH
(post_content, post_title)
AGAINST
('string' IN BOOLEAN MODE)
ORDER BY
score
Does this really work? I mean, the "normal" mode disregards posts where the search terms is 50% or more of the post. So if I have a post that contains "string string text", and execute the query above, do I get 0 as score?

I know you shouldn't use fulltext if the posts only contain such small texts, but that's a part of my problem. The search engine should give extra weight to headings and bold text etc, and these aren't always more than a few words. So the problem is that the normal text on the webpages will be long enough to use fulltext index on, but the headings won't. So how would I solve that?

First, I thought along the lines of a table like this:
tbl_texts
t_id - primary key
t_fk_pid - foreign key to the webpage the text is on
t_text - the text, fulltext index on this one
And then search this table with fulltext search, group on t_fk_pid, and SUM() the relevance score and order by that. Should I perhaps split it up so that texts shorter than 5 words go in a seperate column, and treat that differently?

Any advice is appreciated!

Posted: Oct 13, 2006, 02:05

View 2 Replies!   View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved