473,326 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Seacrch text using php

268 100+
Hai friends

I have got the contents from database But i need to search the content if any worsd available in the contents

For example when I get the pargraph from the table then i find "Style" this word is avaliable in the paragraph .

How can i find the text in the paragraph?

__________________
Thanks
Vssp
Nov 25 '06 #1
3 1174
ronverdonk
4,258 Expert 4TB
Bit unclear, your question. Do you want to do a text search on certain columns in a table. You can do that with either a SELECT LIKE or a SELECT REGEXP (regular expression) function.

Ronald :cool:
Nov 25 '06 #2
Atli
5,058 Expert 4TB
Using what Ronald said is ofc best so you dont get loads of data you dont need from the database.

But if you want to use php to search throught the text there are lots of functions for that. strstr() for example

[PHP]// Search for string
if(strstr("needle", "heystack"))
{
// needle found. Do things!
}
else
{
// needle not found. Do other things.
}[/PHP]
Nov 25 '06 #3
// list of words you want to find
$list = array("Style", "href", "div"); // add it as u want

$input = "aStylelkhRefs";
for($i=0; $i< count($list); $i++)
{
if(eregi($list[$i], $input)) print "find $list[$i] in the $i list<br>";
}
Nov 27 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: pradeep gummi | last post by:
I have an XML FILE that is to be converted to Plain Text using an XSL file. Since I just want plain text, I do not want to set any root element during transformation.And if I do not any root...
2
by: Zlatko Matiæ | last post by:
Hello. I have the following problem with MS Access/PostgreSQL combination: There is a form in Access that has an unbound text box, used for entering a commentary of a batch of records. There is a...
9
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and...
8
by: Dennis C. Drumm | last post by:
Is there a way to modify the standard context menu shown when someone right clicks in a windows text box and that would work for all open windows applications? The standard context menu for...
4
by: Arif Çimen | last post by:
Hi to everybody, I have chnged a button text in design mode. But After compiling and executing the program the text of the button do not change to new value. Any Ideas? Thaks for helps.
5
by: Mukesh | last post by:
Hi i want to use AJAX.net in my Existing Application I have already installed the ajax .net ..net 3.0 and using VS 2005 in the old application i have added a new web form then script manager...
8
by: =?Utf-8?B?Q2hyaXMgSGFsY3Jvdw==?= | last post by:
Hi there I've successfully added some .NET validation controls to a page (using <asp:RequiredFieldValidator ...), however when I try to set the 'display' property to 'dynamic', my page then...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.