473,326 Members | 2,061 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.

how to create search engine by using explode function to get answer.

my code is here(it works but doesn't return result if i entered 1st keyword which is not in the database please help me))

Expand|Select|Wrap|Line Numbers
  1. $sqlSelect = "SELECT user_id,name,cat,product,descrip,price,Image FROM   tbl_user1 WHERE name like '%$result[0]%' OR name like '%$result[1]%' OR name like '%$result[2]%'
  2.           or cat like '%$result[0]%' OR cat like '%$result[1]%' OR cat like '%$result[2]%' or
  3.           product like '%$result[0]%' OR product like '%$result[1]%' OR product like '%$result[2]%'  or
  4.           descrip like '%$result[0]%' OR descrip like '%$result[1]%' OR descrip like '%$result[2]%'";
  5.           $sqlSelected=mysql_query($sqlSelect);
Sep 29 '12 #1
1 1516
Luuk
1,047 Expert 1GB
Are you sure all $result[] values do have a value, and are not NULL?

and, shorter, would be:
Expand|Select|Wrap|Line Numbers
  1. WHERE concat(name, cat, product, descrip) like '%$result[0]%'
  2.    OR concat(name, cat, product, descrip) like '%$result[1]%'
  3.    OR concat(name, cat, product, descrip) like '%$result[2]%'
  4.  
To get into more details, some sample data would be nice...
Sep 29 '12 #2

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

Similar topics

0
by: qonhfmwfyrqx | last post by:
Discover how to quickly and easily create search engine optimized affiliate web sites that can make you money, even without any HTML knowledge or search engine optimization skills. Create...
1
by: Casey | last post by:
Hi, How would one allow for possible multiple search criteria using FREETEXTTABLE. For example, my table "listings" has a full-text search catalog, and I may want to: SELECT * FROM listings...
1
by: duzhidian | last post by:
Dear All: I need write a php program online to implement a super search engine, for example, when users input some keyword, my program can search different other online search engines and reply...
3
by: gaganlatha | last post by:
Hi, I want to create a search engine for my site. When i search a any keyword it should take me to that keyword. The keyword may be a country name, name, month etc. If this available in database...
4
by: kinannawaz | last post by:
I have been given a project to build a search engine using c++ i am enrolled in data structure course. I want to convert an html file into a .txt file than i have to search the page with the string...
3
by: mukeshrasm | last post by:
Hi I want to convert this URL http://www.example.com/whateversearch.php?action=search&kwd=whatever+keyword+76sdf789sfd6 To this http://www.example.com/whateversearch/whatever-keywords ...
2
by: mzmishra | last post by:
Hi , I would like to develope one serch engine for my application which will fetch the data from all job site based on the serch cretiria and display in a web page. Can some one give me some...
1
by: Arthurr | last post by:
I have an Access database linked from SQL server and I need to create a search engine using VBA. I managed to create search engine for varchar items, but I cant make it to search numbers as well....
1
by: dhivyacse | last post by:
i! how to create search engine inside the website only without using database
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: 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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.