Jump to content

Recommended Posts

Well, I don't know databases but I am anqiuos to learn..... đŸ™‚

I need to find in which products the string "boekje.jpg" is used in the products description.

Is this the correct string to enter in MyPHPAdmin:

SELECT * FROM products_description WHERE products_description LIKE 'boekje.jpg';

 

Share this post


Link to post
Share on other sites

I would add a "%" to the beginning and end of what you're searching for....ie.

'%boekje.jpg%'

Dan

Share this post


Link to post
Share on other sites

Thanks Dan, this probably would have been my next question đŸ™‚

 

Share this post


Link to post
Share on other sites
Posted (edited)

Would there be an aesy way to output the results to a .txt file?

 

Edit: I now see I can do a copy to the clipboard.....

 

Edited by René H4

Share this post


Link to post
Share on other sites

I haven't tried it but at the bottom of the search results, there is an export button...at least on the version of MyPHPAdmin  that I'm using.

Dan

Share this post


Link to post
Share on other sites

Thanks Dan I found that. Works well.... Also ready for pasting to Excel, not only Notepad.

Share this post


Link to post
Share on other sites

If you are looking for an exact string, you can just use equals. 

SELECT * FROM products_description WHERE products_description = 'boekje.jpg';

You only need to use LIKE if you are looking for a partial string.  E.g.

SELECT * FROM products_description WHERE products_description LIKE '_oekje%.jpg';

Will match any string that has any first character and then oekje followed by any characters and ending with .jpg .  I would not expect that you'd normally want to put a wildcard at the end of .jpg in an image search.  I would think that something like %boekje%.% would be more common (any image with boekje in it, regardless of extension). 

Documentation:  https://dev.mysql.com/doc/refman/8.0/en/string-comparison-functions.html

Regular expressions:  https://dev.mysql.com/doc/refman/8.0/en/regexp.html


Always backup before making changes.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×