0

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)"; 
2
Contributors
6
Replies
12
Views
4 Years
Discussion Span
Last Post by mpc123
0

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.

0

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`);
0

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.

Edited by pritaeas

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.