0

Here is my query that i am running but its returning me nothing even data exists in column i am trying to pass keywords mention by user and searching data in DB and providing result to the user.

My query is:

SELECT fatwa.question_id, question.ques_img_name 
FROM fatwa, question  
WHEREfatwa.fatwa_keywords LIKE "hadees" AND fatwa.question_id =question.id 

While here is my Database: table image

1
  • try this `LIKE '%hadees%' in your query Commented Feb 22, 2014 at 18:58

3 Answers 3

2

Execute your Query like:

SELECT fatwa.question_id, question.ques_img_name 
FROM fatwa, question  
WHERE fatwa.fatwa_keywords LIKE '%hadees%' AND fatwa.question_id =question.id 

More information go to: sqlite_like_clause

Sign up to request clarification or add additional context in comments.

2 Comments

can someone please respond me here stackoverflow.com/questions/21958529/…
actually i am getting id 2 and 3 from first function now i want to call 2nd function for id "2" then do somework for inside for loop and then then call 2nd function for id 3
1

Use single quote with like statement:

SELECT fatwa.question_id, question.ques_img_name 
FROM fatwa, question  
WHERE fatwa.fatwa_keywords LIKE '%hadees%' AND fatwa.question_id =question.id

question_id should be an integer.

2 Comments

1

Change your query to the following:

SELECT fatwa.question_id, question.ques_img_name 
FROM fatwa, question  
WHERE fatwa.fatwa_keywords LIKE '%hadees%' AND fatwa.question_id =question.id 

you are not using like command properly.

3 Comments

@RK check your query plz.
@ArtooDetoo Sorry wrote them in a hurry from a personal example. Editing now.
@RohanKandwal can u pls check this stackoverflow.com/questions/21958529/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.