Hi Im haveing a problem with ucwords and FINDINSET in a query I have tried all sortsof ways but just get errors

I currently have and get FUNCTION ucwords does not exist. Can anybody help please

$query = "SELECT * FROM TABLE1, TABLE2 WHERE FIND_IN_SET(ucwords(TABLE1.field), TABLE2.field)"; 

Recommended Answers

All 6 Replies

ucwords is a PHP function, it will not work in an SQL query. I don't think you need it, unless your database is configured to be case-sensitive.

Hi thanks for reply, yes but i cant find a query in mysql that will update the field to ucwords

do you have that option please? Itried it with this but got FUNCTION ucwords does not exist

UPDATE `TABLE` SET `field` = ucwords(`field`);

Am not sure there is one in SQL. So either you get the fields from SQL, update them in PHP and then update the database, or you need to find/write a stored procedure that does this.

WOW too complicated for me , any advice for a start?

ok thanks

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.