I want to search all record from database on multiple(comma separate) keyword like php,mysql or php with like .

mydatabase record

 id    skill
  1    php,java
  2    php
  3    mysql
  4    java,mysql,php

if i search mysqlthen total record should be 2 and search php,java it should be total record should be 3

please help me

Recommended Answers

All 2 Replies

In MySQL you can use a fulltext search. Create an index with skill column:

alter table skills add fulltext skillindx(skill);

then you can use queries like this:

select * from skills where match(skill) against('mysql');

There are some limitations that can be bypassed if you properly configure the database server. The MySQL documentation explains everything:

Bye!

You can use FIND_IN_SET(). That would mean if you want to search for php,mysql for example, that you need to split that string and build your query.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.