Database Search -text Database...
Can anybody tell me how to search a flat file database delimited by |. I have exploded the data and managed to get it into a table but want to restrict the final table contents by a search.
The table code at the moment is below - I'd be using a htm file to submit the data. and hopefully be able to search by partial searches eg big would return big and bigfoot. Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Search From Database
IM looking for a better way to get results from search? IM currently using mysql_fetch_array and don't want my search to be in order. So if someone search for a word mysql_fetch_array will search in order of witch one was added to the database or from last. What I would like to have happen is more random or wildcard search. Is there a better way?
How To Search In A Database
I have a table called "lista" into my mysql database.This table has 5 text columns : "TRANSLATEDTITLE" "ORIGINALTITLE" "ACTORS" "DIRECTOR" "YEAR" , and 1 image column called "COVER". I want to create a page with a form to search entries into this table, and anotger php page with the search results shown inside, everyone with a link that opens a pop window (ex. 400X320).
How To Search In A Database
I have a table called "lista" into my mysql database.This table has 5 text columns : "TRANSLATEDTITLE" "ORIGINALTITLE" "ACTORS" "DIRECTOR" "YEAR" , and 1 image column called "COVER". I want to create a page with a form to search entries into this table (ex. with Title, Actors, Director, Year), and anotger php page with the search results shown inside, everyone with a link that opens a pop window (ex. 400X320). Who does give me an hand ??? I've seen the Codewalkers solution, but it searchs with another metod of searching (a selectable string with different category of searching). I need a simple search script with these two pages...
Search A Database
how do i seach through a specific column of data within a database for the highest value?
How To Search Without Database
i am developing a site and everything on the site is static meaning no database. now, they wanted to add a search tool bar thats is only meant to search by keywords my problem is i dont know how to do it because i have done it before.
Search Without SQL Database
Anyone able to point me in the direction of a no database php search tutorial or throw up an example. Basically, I need to search for non HTML elements pages within a directory.
Search Database - MATCH() AGAINST() Or LIKE
I have a fairly basic database that holds articles that visitors of my web site can search based on content of the articles and the author. Simplified the tables look like this... articles +-----------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------+--------------+------+-----+---------+-------+ | doc_id | varchar(8) | | PRI | | | | title | varchar(255) | YES | MUL | NULL | | | date | date | YES | | NULL | | | source | text | YES | | NULL | | | abstract | text | YES | MUL | NULL | | | body | mediumtext | YES | | NULL | | +-----------------+--------------+------+-----+---------+-------+ authors +---------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------------+--------------+------+-----+---------+----------------+ | author_id | int(11) | | PRI | NULL | auto_increment | | doc_id | varchar(8) | YES | | NULL | | | author | varchar(100) | YES | MUL | NULL | | +---------------+--------------+------+-----+---------+----------------+ The Authors name is kept in the form of first initial, middle initial (if known) and last name (ie J. Bloggs). Basically users have two fields they can complete for searching. One is the keywords (ie words in the body of the article) and the other is for the author of the article. Currently I perform a full text search to find authors that match the author they enter but I'm not sure this is the best method as authors with short last names (ie. Li or Cho) can't be found. This is the code I am using to generate a query to search the database. PHP Code:
Search Item In Database
I made a function that does a case insensitive search. This works fine. But i'd like to improve that script so that it also returns items from the database that are partly similar to the search string. this is the script atm:
Database Search Engine
how do i make php script for searching in mysql database? i want to make a student search.. the field is student_number, name, address, and faculty. what would the php script look like?
How To Search More Than One Table In A Database
Say I have a user input a search string and they click search. What would my mySQL string look like if i wanted it to search TABLE:'set_01' and TABLE:'set_02' at the same time for the same information?
Some Database Search Tips
I have this database where I get like thousand of searches every day. But I think it is running a bit slow. Do you have any tips on how to improve it and keeping it flow.
Database Search Problems
I have managed to connect to the database fine and I think I understand that I want to post the information, and I am posting it to the page that I am currently on, as I want the results to be displayed below the search form. There should only be one result no matter what search in entered. I am getting some results, but they are inconsistent. Postcode seems to work but nothing else, the other 2 input fields always return the third record in the database no matter what value is entered. Code:
Database Search Results
i have a paid to read website,im hosting it off my own pc..as a member you can search offers and complete them, heres where i need some help..when a member clicks submit and the offer goes to an offerdone table i need the offer to hide from them so they cant do it again,also that same offer needs to hide in the search results as well...is there somthing like onclick hide and for the results something like if duplicate hide from search or if offer found in this table hide from results... there are 2 tables one will all my offers the other with offer they have done,also this needs to apply for each member account.i am new to all this and have made it this far to have my site up and going but im looking for those extra catchs i could really use,so that a member cant repeat an offer they have already done,
Suggestions For A Database Search Engine?
The site that I am currently building has a products catalogue stored in a database spread over three tables: products (holds all the product information, brand, model, description, price etc...) categories (Holds all of the categories and sub-categories) products_categories (links products and categories tables). Right what I want to do is implement a search engine that will search through the products table for the keywords inputted by the user and, displays a list of all the products / pages with the relevent information. I am rather new to PHP and MySQL and I'm not sure which way to tackle this, any suggestions would be appreciated. If you need any more info on the the tables and whatever please say.
Fastest Way To Do Database / Array Search
I am trying to write a script that allows users to search through a database of names. But rather than give a search string and then return all those that match, I would like it to search each time the user types a new letter in the text box. That's badly explained - this example might help! The user types "r" and I displays all the names with r in them. The user continues and types "i" so the textbox shows "ri" and displayed are all the results with "ri" in them. I as doing currently this by re-querying the SQL database where the names are hosted but it takes too long to query, return and refresh the page. What would be a better way of storing this database info to allow a faster search? Maybe load it into a PHP array first (stored in another file) and search within that? (Can you do 'clever' searches in PHP?) Or into a javascript array? The list could be upwards of 1000 names. The databse shouldn't change that often so I could have a script that updates the array every 24 hours or every time a new name is added.
Search Tags In Mysql Database
I'm creating a website that lists snippits of online articles. As tagging these articles will be very important, I've created a database structure as below. I'm now implementing searching of these tags with the hope to sort potentially 1000's of matches by relevance on tags and on date (the newer the better). Before launching head first into this, can anyone point me in the way of a good tutorial specifically on tag searches. (I can find plenty of fulltext sytle search information, but not so much on tagging). Code:
Database Driven Pages On Search Engines
I know this has been discussed at length in these forums from the searches that I've done, but I have a new question of sorts. Basically, I found several solutions to the problem of using PHP/MySQL database driven pages and getting them listed on search engines. One method that I've chosen entails listing the variables in between backslashes after the name of the document, like this http://www.something.com/index.php/test/1234 After a few problems, I've been able to get all of the pages in the first group (I just added the 2nd and 3rd group today) to list perfectly on Google. I'm psyched about this working on my entire database of 10,000+ products, but I'm worried that I may be overlooking something. If possible, please check out that link and if anyone knows of any shortcomings or pitfalls with using this method, please let me know. Thanks a ton.
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?
Text Not Right From Database
I have a Profile section in my users registration, but if you enter a few lines and a few 'enter spaces' like <BR>, then the <BR> spaces do not appear and the text is continuous! my profile section is just 'text' in the database..should i change this to blob or varchar.? I also need the same fix for my news part! which is over 255 chars!
Database Row To Text File
I need to get the contents of a MySQL database field into a text file, and write the file to the server. I can not seem to get any filesystem functions to work, because it tells me I do not have permission to do anything. I am on virtual hosting, so it seems easier for me to try to FTP files to my own server. Perhaps you guys can give me some pointers, this is kind of the idea I am running on:
Plain Text Database
i'm really a newbie to php but not OOP. i'm designing a database to hold simple text messages to display in a page called, "News". The client doesn't want a sql database so I suggested a plain text database. I have it working but when I pull the data (fopen) it all comes back as one line. It's set up as a simple form passing 2 variable, $title and $comments. They both write (fwrite) just fine to the .txt file but upon retreiving them (fopen) it's all one line. Since I can't pass formated text to a .txt file is there a different way? As a newbie I haven't come across a solution yet. The client wants this soon so I'm asking here due to the timeline. Given a few more weeks I'm sure I'd stumble across it in some text.
Text File Instead Of Database?
Does anyone know a script that I can use to manage members of my website (preferably with a control panel-type interface) but without using a database? I read on hotscripts.com of one that uses text files instead, but the link says that the site is no longer offering that file. If someone could help me it would be great, as I know nothing about scripting. By control panel, I mean a page that I can go to on my site (not open to the public) that I can use to Admin the users. I would like it to go something like this: (this is what was offered at hotscripts.com) New Members Username: New Members Password: New Members Name: New Members E-Mail Address: And optionally (I don't really need it, but if its possible, hey why not) a place for me to put in an admin username and pass to get into the page mentioned above. I would also like to be able to implement this script on my main page (see here for what I mean.
Preparing Text For Insertion Into Database
I insert text into a MySQL Database using a TEXT field. PHP syntax is: $query = "INSERT INTO data (text_field) VALUES('$text_field')"; The problem is, when the user has an apostroph (like "friggin' cool") in the text, MySQL misinterprets it, and the query is invalid. Is there a PHP function that formats the that input so it can be entered into the database?
Storing Article Text In A Database
I have a website with an increasing amount of articles and news reports and so I am thinking of moving away from storing each article as a seperate page to having a single page and storing articles in a databasewhich are retrieved using a GET parameter. I see the advantage to me in using this approach as being making use of MySQL's fulltext search capability and less work needed when updating the design of the page. I'm not sure of a few things though: 1. The exact benefits of fulltext. Can someone provide a brief explanation or a good website 2. I imagine that storing just the plain text of the article in the database will result in a single block paragraph when retrieved into the page. Do I need to include the HTML markup with the text in the database or is there a different approach? 3. Will the HTML markup in the article interfere with the ability to search for words i.e. if I have a word "recipes" in an article that is surrounded tags like <b>recipes</b>, will a search on this article pick out the word from in between the tags?
Load Into Database From The Text File
i'm having difficulties here to load a text file to my database... let's say if i've a table named "train_info", and the field for that particular table is user-id, training_hours, training_date. let's say i've a text file that looks like this : " 123434 12 2002-08-03 545322 10 2002-08-03 533434 12 2002-08-03 654333 12 2002-08-03 535434 12 2002-08-03 " Is it possible for me to read such text file to be inserted into my "train_info" table?
Submitting Text For Use In A Mysql Database
This question has been bugging me for month. I have a website where people can enter stuff into a mysql database. Some of this information will already be shown in some textareas and input boxes, the user may change it and then hit submit. All the values are then passed to a mysql database, overriding the existing values (after the old ones have been backed-up). All of this works marvellous, apart from characters like &, ' and ". To make it even worse, some of the original text already contains &039; and other numeric character codes. Any values from the database are displayed by retrieving them from the DB [simplified of course] mysql_quer(...) $row = ... $Vold1 = $row[x]; $Vold2 = $row[y]; etc... <INPUT VALUE=$Vold NAME="x"> <TEXTAREA>$Vold</TEXTAREA NAME="y"> Any values that are submitted are processed as follows: $V1 = trim(stripslashes(htmlentities(trim($_POST["x"]))))) $V1 = trim(stripslashes(htmlentities(trim($_POST["y"]))))) then $V is inserted into the table using a mysql query.
Large Gap When Editing Text From Database
My first PHP project is a very simple blog system and I have a page which lists blog entries. This page provides a link to the edit page, when clicked opens the edit page and inserts the values from the database into the from. My problem is that it puts in a large gap of two tabs and two spaces the start of the from. The challenging thing is that if I slick submit, the gap is not put into the post.
Convert Text From Database For HTML
I'm pulling text from a database (MySQL) and I'm using the nl2br () function to convert the line breaks DESCRIPTION="<?php echo nl2br($row_rsttheJobResults['description']); ?>" This creates the following example "A new line will be created soon < 'br' > and here it is." However the website that receives this cannot accept the characters < and > So I want to convert this "< br >" into this "<p>" Could anybody help me add to the nl2br () function to convert the < br > tags? * the spaces between the < and br are there because they won't show in the message otherwise
Help? How To Create Next Buttons When Using A Flat Text Database
Ok, I know the code below does not work but I am wondering about the logic... 1 How do I just print 10 rows. 2 How do I get the buttons. You get the Idea. Anyway, I would like to know if anyone has done this with text files. I always see mysql as examples but nothing using a flat text database. <? $maxResults = 10; $datafile = "sometextfile.txt"; $rows = @file($datafile); for($size=0;$size<count($rows);$size++) { $rows[$size] = chop($rows[$size]); $coll = split("|",$rows[$size]); // print something } if ($size > 0) { $currPage = $size / $maxResults; if ($currPage > 1) print("<A HREF="test.php" >['prev']</A>"); for ($i = 0; $i < $size / $maxResults; $i++) { if ($currPage == $i + 1) printf("<A HREF="test.php"> </A> ",$i + 1); else printf("<A HREF="test.php"> </A> ",$i + 1); } if ($currPage < size / $maxResults) print("<A HREF="test.php">['next']</A>); } ?>
Displaying Information From A Database In A Text Field,
I am trying to create an admin page, but before I get anywhere near that, I need to understand how to get data froma database to show up in appropriate form fields *text, textarea, etc...* I am able to get content from my database to show up in my template, now I want to create a page that allows a user to click on a link for which they want to edit the information (name, and bio) So I want that page to show up with a simple form, a text field displaying the name, and a textarea displaying the bio information, so that they can modify it and save it to the database. how do you get the information to show up in the form fields? Code:
Remembering Text Box (pulls Data From Database)
I have a text box that i want users to enter in data. If the data, however, is matching data in the database then how can I have the data show up so the user can select a entry that has already been put in. Example: In my database i have 3 entries, Jims Collision Jakes Paint and Body Sams Auto Now when the user goes to enter data into the text box it will bring all entries up. If he enters a "J" for his first character input then Jims Collision Jakes Paint and Body will show up underneath the textbox only. And if they enter a "S" only Sams Auto will show up underneath the text box. Google has this on their search engine stuff. How does it know what i last searched. Also, Quick books has this as well if you go under "Write a Check". I hope this is enough info, if not let me know.
$_POST Identical Text Fields Into Database
I have a list which is pulled and displayed from my MS Access database. Next to each row, is a text field which appears evertime a new row is displayed and that is called 'code'. I want any text field filled in by the user to be sent into my database, into one field all separated by commas. I have made an attempt at this in the second example script but it needs tweaking. I have here my script which pulls the list from my database: Code:
Displaying Block Of Text From MySQL Database
I would like to create a details.php page that displays all my products. I understand how to get the title, price, description etc from mySQL. But my problem is how do I get a list of data? For example say I want to display the features of a product in point form (list). What is the best way to do this? How do most common websites do this? Code:
Uploading Info From A Text File Into A MySQL Database
what would the PHP and SQL code be to say basically: make a new row and put this in the field, what comes after each comma goes in a new field, and each new line should be a new row. I have a huge text file that i don't have a way to upload directly into a MySQL database because my webhost isn't allowing it for some reason.
Complicated Email Parse Or Text Extraction And Database Insertion
I am trying to strip some data out of numerous emails and place it in my database. I know that this seems as if it has been done before. But, this is a little different. First, the numerous emails all have a set of data that needs to be extracted and inserted into the database. Some of the data in the email is id, name, address, city, state, zip, company, etc. The catch is that the date is formated and presented differently in each email. Take into consideration the following email examples: - excert from email #1 ID:.............. 12345 Name:............ JOHN DOE Address:......... PO BOX 9999 City:............ Somecity State:........... CA Zip Code:........ 90210 ....
Select Specific Snippet Of Text, Replace With A Database Result
I'm having some problems trying to do something; I just can't think of a way to do it. Basically, I want to search for a specific snippet of text in a body of text, then replace it with the requested database result with some thrown in HTML. Users will be able to type the following (or something along these lines, depending on what works best): [image=12345]Insert caption here[/image] Then I need it to search for the requested image in the appropriate table and return the image's url (for an example, let's say the table is called "images", and the columns required are "imageid" and "imageurl". Code:
Images In Database Vs. Image References In Database
i kept all of the uploaded images as files on the server, and created links to them in the database. I have been changing things around now (especially directories) and I am thinking of storing the images in the actual database. I read somewhere that this can be considered a bad practice, so i was wondering what the consensus here was. In my opinion, modifying all of the code to point to the correct directories everytime a page location changes seems like a pain in the a**.
Smart Text Search - How To ?
I've got a list of names in a mysql table: example: Mike John Peter .... (100,000) entries How do I perform a search in this table, so that it is tolerant to mild spelling errors ? Am I looking for a phoenetic search algo ? Or is there a simpler algorithm to do this ? Or perhaps a PHP library for this ? For example if someone searched for "Jon", he should find "John" from the table.
Search A Text For Linebreaks
Got some text that contain url`s. Whenever there is an occurence of the string "http://" its going to read what comes after it - until next whitespace and make a link of it. But theres a problem when the link is at the end of a sentence, then it doesn`t treat the linebreak as a whitespace and the first word on the next line is treated as a part of the link. Is there any way I can search for linebreaks in a text/string?
|