Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Anyone Knows How To Search In XML Just Like SQL?


Iam trying to look for ways how to search inside an XML document
like searching a database that has a select statement in SQL?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Search Script Don't Search Empty Values
I'm trying to make a search script. I don't want the script to search for empty values if you don't write anything in one of the searchfields. Does anyone know how to do this, or where I can find examples of advanced searchscripts? Code:

Search DB Using Multiple Search Criteria On Web Form
I have a mysql database with a table with fields ( surname, company, speciality etc..)
I created a simple form so people can search using criterias ( a search field which query all fields , a drop down with the list of surname, drop down with the list of speciality, drop down with a list of countries ).

My system works perfectly well as long as I use only one criteria, However if I select "Plumber" as the speciality and "Scotland" as country, I will get all the entries for Scotland ( even if the speciality is not "plumber") and I will get all the entries for "Plumber" ( even if the coutry is not "Scotland"). Code:

Highlighting Of A Search Term In Search Results
I am writing this simple MySQL and PHP search and what I want to do is to highlight the search term in the results when they are displayed on the screen.  I am able to get it to work. but the seach term will only be highlighted(Make it Bold) only if it matches exactly to what was typed in the search box. 

Is there a way where the search term doesn't have to exactly match in order for it to be highlighted?  Below is the code where I change the the search term into bold to be displayed on the screen.

<?php
$result_manufact = str_replace($splitstr, "<span style="color: red; font-weight: bold;">$splitstr</span>", $manufact);
?>

I Want Search Script Which Can Search All Pages Under Given URL
I want search script which can search all pages under given URL...
because i want to search my text in given website (like Google's
Domain search)

Search Multiple Search Engines
Does anyone know how it may be possible to write some code to search multiple search engines?

Search Results ($num_rows) Does Not Match $search Results (PHP,MySQL)?
For example, when I do a database search for a term I get 2 results but the $num_rows says there are 3 results.

I suspect it's because there are similar keywords within different search fields of the SQL statement. But I am stumped as to how I can change this. Any Suggestions? the code:

Possible From Search Box
Is it possible from search box; to remove word like and ? or any non-key words. I do not want to build a array of words for them to search. All I am saying is - User try to search for and, I want to kill the word and.

Also when user search Blast you can enter last and if the word Blast is in a sentence it will show in relsults how do you stop this from happening?

Here another subject:
If the user miss-spells a word offer them the correct spelling? or sim word. This sounds pretty advance where can I learn how to do something like this?

Search
I'm having a problem with a php3/mysql results display. The problem seems to lie in the search parameters passed to the script, and the Next/Previous links. The parameters are passed from a dropdown boxed called "prodname". The results display aren't relevant to the queries, and somethings aren't displayed at all (even with the wildcard). I've tried different variations on the $prodname%, but with no improvement. Code:

Particular Search
I have a image-website that displays various photos. each photo's are
labelled with integers. I would like to know if there is a method of
converting the integers into a string and gettin a count of the number
of downloads of a particular image.

For eg:
these are the images dloaded by a single user
IMAGES:- 7001,7025,7841,7459,7584,7741,7415
Assuming that i have assigned each of these variables to a string as
$picname=$7001.
Now i would like to search thru the list of numbers and find out which
photo was downloaded how many times i.e no. of hits of each picture.

I thought of using an case block but then the I had to place a counter
for each picture seperately.
Is there anyother better way of producing the same result?

PHP Search Box...
I want to create a search box for my site in PHP. This will only be
to search my site and not the web.

I have never done anything like this before.
Is it difficult to do this in PHP?

Does anyone know of any tutorials etc.. on this?

Search From A Map
I am trying to locate a plug and play piece of software that will allow me to use a map to tie to a search feature. Where you choose a state from a map and then a county and so on. I have been searching the web for days and cant find anything let alone even know what to call it.

Search Within A Search Within A Search
I'm having some trouble with the search field that i am setting up
using PHP and HTML, I am connecting to a database to return proper
information pertaining to something being searched. I originally set
up a search to work like this :

$SQL = "
select id,
name
from repository
where upper(name) like upper('%$search%')
";
$Result=SubmitQuery($db,$SQL);
while (OCIFetch($Result)) {
$repo_id = OCIResult($Result,"ID");
$name = OCIResult($Result,"NAME");
echo"

and display the results accordingly, This was one teer of the
searching, the database would then search modules and files just as
seen above, but I ran into the problem where the correct values are not
being passed, so it was searching all repositories, then all modules,
then all files.... is it possible to search like this:

Repository #1
---Module #1 in Repo#1
------files in Module #1
---Module #2 in Repo #1
------files in Module #2 Repo #1
etc.



Repository #2
--Module #1 in Repo #2
etc......

is this possible to do a search under a search under a search with SQL
PHP?

Search
I was wondering how to have it so that if someone searches hi any posts with hi will come up? or if some searches hi how are you any posts that have "hi" "how" "are" "you" (without the quotes)comes up?

Job Search
I have a client who is requesting this on their website:

"A visitor does a job search, listings come up, then, at the bottom it
has a place to submit your email if you want to be notified when more
jobs that meet your search criteria are posted."

I've search on Google to try to find out what you would connect to to pull the job listings. Does anyone have any ideas on how I could go about doing this?

Php And Search Engines
Ok I really love php and wish to use it for a lot of my web projects. However there is one main downside especially for e-commerce and that is that the php and database generation is not indexed by search engine spiders.
Which is unfortunate since in my testing dynamically generated sites seem to be much quicker than static ones.
So what is the answer, I have developed a few scripts which index the database to produce static html, however is there a better way?

Search Queries Help.....
Hello there I was wondering if I could possibly get some help./

I know basically what I want to acheive, but trying to work out the best way of getting there.

I currently have a music database that I do not allow duplicate entries on artists name in.... But there is always the possibilty of mis spelling their name etc etc.

Is there a way that I can perform a query to find all entries in database sort by relevance and pick the top result as the one they should have?

Example:-

If the user imputs :-blue dirt or dirt,blue

But the correct Spelling for this one is actually :Blue Dirt

How would I go about checking the entered data against the correct in more of a "Sounds Like" search envirnment??

any help or suggestions would be greatly appreciated.....

Date Search
I'm trying to search a range of dates on a sql server using PHP. Giving it one date and it will look for something X many days before and after that particular date. The problem i'm running into is the fact that the sql server reads dates like yyyy-mm-dd and php does it mm-dd-yyyy. I'm trying to use the sql commands to search for the date, but the problem i'm having with that is my dates have dashes while if i use the add_date() or sub_date() function the input don't use dashes. take a look

$sql="SELECT * FROM search_data WHERE date_sub($date,interval $number_of_days day) < $date AND date_add($date,interval $number_of_days day) >= $date ORDER BY file_name";

Is There A Search Thing?
Can I search a variable for certain keywords? Or even better replace it with something else also? In PERL I know it was like $var = s/blah/blah;

Regeps Search
I'm using regular expressions to search for two words separated by 1 or more space characters (tabs, newlines etc), but I could really do with the position at which it finds this in the string buffer. ereg() only returns true or false, so is there a way to find out the position using regeps?

Failing that, is there a way I can get regeps return the space(s) so I can stick them and the two words together and perform a strpos using that?

Random Search?
If i have a database. how would i randomly search it, that is selecting 1 or more thing(s) from it, every hour or day.

EBay Search
I have seen the PHP scripts for searching a EBay users list by their EBay ID and also by an item number. However, I was wondering if I could pull ALL the "new" entries from them WITHOUT having to enter a specific user one at a time. I want to import the results into MySQL.

Is This Possible With Search Results
Is it possible that when someone does a search on your database, that the results are downloaded as a text file?

Search More Than 1 Table
just a curious question on how you people would go about making a search script that wil search 2 different tables on 1 search word and display all the results on 1 page.

How To Search An Array
Need some help figuring out how to search an array as its the first time i have done this..

array_search($username, $admin_details, $admin_useremail = $admin_details['email']);

this is what i thought would work but has'nt, basically i am searching an array called $admin_details for the $username when it finds it i want to pull out the corresponding email address as $admin_useremail. make sense? Not too difficult i hope.

String Search
I am building an email system.

I want to allow users to add their own html code and also to track who click on the links on this email. for this I need to find all the links in the html string that the user inputs in the form.

What I want to is once the html code has been submitted analize it, find all the links in it and then present them in a list to the user so he can decide what he wants to track. Once he has made his choice I need to get back to the html string and replace those links with a piece of code that will allow me to track the clkick through.

Is this possible at all?

Also, Is there any way to track how many emails bounced back and how many autoresponders?

Domain Search
We wish to allow customers to search for domains availability from our website. Please let us know how to integrate this feature in our website.

Search Engine
i am looking for search engine which can search various websites from one
location. for example which can serach: athens, online library, organisation pages, all resources from one single location.

Php And Search Engines
I've got a site built around a few php programs, when the page is requested it uses htaccess to call a php program with the page name. This page name is used to extract title/description/keywords/h1/h2/alttext/copy etc from a database and then populate the page. The site works well and I only have 2 or 3 programs to run a large site based on a database. The problem is when I run it through the spider test on this site it doesn't pick up the title/description or keywords. Is this something to do with the page being built on the fly, and if so does anyone have a solution to this?

Search In String
Is there a predefined function to search a string for specified characters/words, anything defined ahead of the time?

Php/mysql Db Search
Anyone know of a really good php/mysql search tutuorial? Something not too complex but with some features.

Search Forms
How do I make the form to search freely within the database? As of now, if a word is entered, it only displays results containing names that start with that word. This is how the form looks like..
[...]
AND `entry` LIKE '$entry%'
[...]
*entry* being the field in the database. This isn't a search engine, but it displays results from a mysql database..

PHP Filename Search - Possible?
I have a directory of pdf files

13344.pdf
21488.pdf
etc

Users want to search for a particular pdf file and have that displayed to
them. ie user searches for: 13344

Is it possible for a PHP script on its own to search a folder based on file
name and retrieve the pdf file or will i need to add the files name to a...

Search And Replace
im developing a script which basically searches and replaces strings on
remote sites and spews them out on the local server, im having a problem or
two with making images come out right, i dont want to download the images to
the local server, i simply want them to grab them from the remote server

in addition, i want all links to link through the script that is grabbing
the site, heres the code so far: Code:

Search Engines.
i have a car showroom and i was wondering how i can do it so that seach engines can crawl my showroom. it looks like this detailed.php?model=Cadillac&make=Escalade can anyone point me into the right direction?

Search Algorithm.
I'm trying to master the ability to search through large amounts of data for what the user really wants. I have a list of words (viewable at http://bludwulf-bsd.dyn.dhs.org/glass/definition.php along with the current incarnation of my search engine) that I'd like to search through.

So far I've tried to use the 'similar_text()' function, but I now realize that's quite hopeless. Case in point, if i have an entry called 'air hoses and related topics' and the user searches for 'air', it will be ranked low because its a comparatively long entry name. (Other entries are shorter, most of them one word)

Is there a better way to do a simple search like this? I don't want to simply search each entry for the search string, as lots of them are italian words which are frequently miss-spelled.

Printing *.php Search To *.htm
I've got a search(search.htm) page that searches(find.php) the database and pulls Player, Pos, and Team. Right now the script runs a prints in find.php. I want this to print to search.htm. I've looked at php.net but haven't been able to find much that clicks in my head....I've got the search script that works fine but the printing is what I would like to change.

Strong Search?
I have a php seach form and I was just wondering if someone could take a look at it and let me know if there is anything that I could add to it to make it really reliable. I know it works but the thing is it might be used pretty heavily and I want to be sure it wuill stand up to the test. Also I have it ordereing by one field at the moment, I want it to order by two fields, can someone help me with this, thanks. Code:

Search Grab
I'm trying to make a php script that grabs results from a search on GoTo.com that searches through my websites GoTo affiliate ID. I want to have the search results echo'd on a page on my website. I was using eregi(), but I just can't seem to get it to work. Here is an exampe search results page: http://www.goto.com/d/search/p/befree/?Promo=befree0031906632173874949 0&Keywords=turntables&Promo=befree It's a search for "turntables"...any help would be greatly appreciated. =]

Search Feature
i have been developing a shopping cart for about 2 months in php, and im adding the finishing touches. I want to make it searchable. Right now i have a database, with a field called "name" that holds the name of the product. If someone searches "apple" how can i make it match a name such as "the big apple".

[FAQ] Search Engines And PHP
Q: Is PHP search engine friendly?
Q: Will search engine spiders crawl my PHP pages?

A:
Spiders should crawl anything provided they're accessible. Since,
nowadays most of the websites are been developed with PHP, you are not
supposed to doubt that.

As a proof that PHP pages could be crawled and indexed, refer this
Google search
<http://www.google.com/search?q=inurl%3Aphp+filetype%3Aphp>

Q: How can I submit my website to search engines? Should I use PHP to
submit?
A: Consult their documents. It is always better to categorize your site
and submit to DMoz. Usually, PHP has no role here; but however some
search engines (specifically Google and it's sitemap protocol) provides
option to inform them the changes using a ping mechanism and here PHP
could be used.

Refer:
http://dmoz.org/add.html
http://www.google.com/webmasters/
https://www.google.com/webmasters/s...s/en/about.html

Q: How to indentify the spider?
A: You may identify it by user agent and or IP.

Refer:
http://www.iplists.com/
http://joseluis.pellicer.org/ua/
http://www.pgts.com.au/pgtsj/pgtsj0208d.html

Q: Will search engines follow redirection? If so, what URL will be get
indexed?
A: Yes, the final URL

Q: Will search engines handle cookies?
A: No.

Q: Will search engines handle sessions?
A: No, if your session is cookies based. If there is a provision for
URL rewriting (ie, trans sid feature), it will handle or maintain
sessions.

Q: All the pages in my website use session. But, I don't want the URL
rewriting as it results in uglier URLs (appended with PHPSESSID).
A: Then, you may selectively enable trans sid feature only for the
search engine spiders by sniffing their user agent and or IP.

Q: Will search engines save the links with the session id (PHPSESSID)
in the URL?
A: Majority of the search engines automatically remove the session id
in their index. But, there are also report that few search engines
(more specifically MSN) don't remove them; in that case there are
chances that the session of more than one user (when they visit the
site via search engine) may be shared/hijacked provided there is not
enough measures taken into account.

Q: How to optimize my site?
A:
Make the contents accessible. Be sure to validate your HTML and stick
to W3C standards; this will help the search engines to see your access
your contents easily.

But, also remember that most of the SEO (Search Engine Optimization)
theories are big hoax and it's a crazy business. If you provide good
quality of service in your site, hardly it won't get visibility.

Refer:
http://www.w3.org/QA/

Q: I prefer more visitors via search engines. What should I do?
A: As said, believe in the good quality and you'll definitely be known.
You may also opt to advertize in the search engines, if you strongly
believe in advertizements.

Q: Please give me some quick hacks for my website to get more visitors
through search engines.
A: Since, many search engines are now contents based (previously and
still few search engines used META keywords), enough keywords on the
page might help.

So, some people use the cloaking technique, in which different content
is been provide to spiders by sniffing their user agent string and or
IP. Some people use also keyword stuffing techniques, in which the
keywords are largley stuffed to a page and probably hidden using CSS or
so. And, all such "fooling" techniques are highly against to the search
engines' TOS and as a penalty the site might even be get blacklisted.
Some search engines like Google even employ people to evaluate the
quality of their search results and provide option to lodge complaints
against any "fooling" sites.

Q: What is PR?
A: In search engines context, PR would mean Google's PageRank (tm)
algorithm that determines the rank of the page determined through the
number of pages linking to it and the rank of the linking pages. Hence,
PageRank can be used to find the popularity of that page. However, this
would hardly affect the position of a webpage on a search page and can
safely be ignored (Some SEO business people may not agree with this)

Refer:
http://en.wikipedia.org/wiki/PageRank

Search And Replace?
does php have a function where it can search a database record and replace it with something else? example. say i have a record in a database and in that record theres a www.domain.com and i want php to search that record and replace that www.domain.com with <a href='www.domain.com'>www.domain.com</a> make any sense?

Search Question
I have a mysql database and am connecting to it using php. I want to do a search that involves scheduling a computer. Basically I have a form that requires a user to input into text boxes, the computer name(e.g lspg462081 - but it could be any computer from the mysql database), the start date(any date), end date(again, could be any date) and the
lab name(e.gTech optaplex, but again it could be any one of a number of labs.).

If the computer is taken on a particular date, I want to show that record on a results page. Does anyone know how to begin this or the sql required to limit it to just that record I have attached the layout of my form. You may need macromedia to open it.

Search Replace
I'm trying to find some help to be able to search through a given string and change any occurence of &qoute ONLY between < > brackets... and keep the whatever else is in between those brackets the same. $string = "Hi i'm dumb &qoute < &qoute >" Only the one in brackets should be changed.

Search By Date
i have the date stored like so:

0000-00-00 00:00:00 YYYY-MM-DD Time

$year and $month are assigned from the URL, but I'm not sure how I do a query to find all records with a date in this month and year?

Search Pages
I am making an application that lets you upload pics to a server and also adds the directory to a DB. Now I just need to display the pics and I want to do it a page a picture. Kinda like a search page. AV or Google style. But instead of a link its a pic and then you can choose to go to the next one by clicking on a link. But the whole time it's one dynamic page pulling info off of a mySQL database.

Search On Numbers
When do a mysql search such as LIKE '%a' How do i search on the numbers [0-9] I have tried LIKE [0-9] but this doesnt work.

Entropy Search
Does this work on php pages? My search is not picking up any of my php
pages

Need A Search Mysql_query
i have been trying to create a search querry for mysite which will de querrying a data base holding jobs and info on them. here are my basic query i will use is there any thing better to use PHP Code:

Search Problems
i got a select statement ,which uses criteria from another form:

$ query="SELECT * FROM ESSENCE WHERE '$_POST[choice]'='$_POST[search]'";

let's say choice=NAME and search=wuff when i run it in the browser it doesn't show what i wanted it to show but when i do this instead:

$query="SELECT * FROM ESSENCE WHERE NAME='WUFF'";

IT DOES THE RIGHT THING.


Copyright © 2005-08 www.BigResource.com, All rights reserved