Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    GIF shows where to locate </> in the thread and or post editor toolbar.
    To learn more about how to use our BBCode feature, review our "How to post your code into threads" here.

    Thank you, Code Forum.

PHP How do I create a query to display the results for multiple fields with multiple values in PHP MySQL?

I want to compare the Multivalue field against the database value using PHP- My.
The database field contains values separated by the Comma.

The PHP explode function might help me. But i am not able to work around with the problem,
Kindly help me to sovle the problem. Check attached image for detailed problem.

match value.jpg
 
To me at least, the screenshot does not hint at any problem. You may want to explain exactly what you are trying to do, and post some code.
 
@cbreemer

I am having data/Multivalue data Comma separated.

E.g.

Field 1 -- Value= 1,2,3,4

I want to create a search like

Search value= 1,2 Match 100%
Search Value= 1,5 Match 50%
Search Value= 1,2,4 Match 100%

The data table has 30 fields. So, Difficult to display the whole code here.

If you still need information. Just reply to me. I will share more information about this with code.
 
Database field contains value like "1,2,3,4,10"

Case 1
i would like to search the value "1,4"
Result needed is 1,4 is present 100%

Case 2
search the value "1,5"
Result needed is 1,5 is matching 50%
 
Sorry to say, it's still unclear to me what you want.

I thought I understood from your latest post, but when going back to your original post, the percentages shown there confuse me. Either some are wrong, of I completely misunderstand. You really need to explain it in words, best as you can. If language is an issue, do it in your own language and then use Google translate.

Also, you simply state your problem (which in this case is very unclear), and then say "I'm not able, please help me". It does not work like that !! You really need to make an effort to explain your problem, and need to show us a reasonable attempt at a solution. Nobody's going to do all your work for you. Since you mention the PHP explode function, I assume you must have some idea of what you could do. If you tried something and ran into a problem, give us the code and the exact error. Don't just sit there waiting for help.
 

Buy us a coffee!

Buy me a coffee.
Back
Top Bottom