update table set field = replace(field,'before','after');
I'm not sure about using regex but you can do multiple fields at once. Like this:
update tblblogentries set body = replace(body,'ColdFusion','ColdFusion'), title=replace(title,'ColdFusion','ColdFusion')
Don't even say it ;p
I have a table with columns of type "time" in my MySQL rdbms and I will need to use CF to retrieve and store time type data such as 08:23:00, ie. 8:23am. Note that MySQL stores time military style, ie. 18:23:00 is 6:23pm.
So the first thing to think about is passing time values in and out of components through the cfargument tag with the right type choosen. Funny thing is that you can use three different types, 'Any', 'String', 'Date', and even 'Numeric'. How numeric works I don't know, but it does. Personally I've just been using 'Any' as a general rule, until they actually add a 'Time' type, if ever.
Using that argument within your query, or cfqueryparam to be more exact, you'd use the cfsqltype of 'cf_sql_time'. Easy enough right? And if your passing around datetime values you can always use createODBCTime function to format it for the MySQL time column.
1. In MySQL 4 you could pass an empty field ("") to a primary key column that is auto insert, in MySQL 5 you can not. Simply take that out of your insert query completely.
2. MySQL 4 was much more relaxed and forgiving about fields not checked to allow null. If a field did not allow null and you passed in nothing on insert for that field, or did not include that column on insert, it would still work. However, for MySQL 5, if a field is not nullable, you must pass in something on insert. Simply allow null for that field or give that field a default value.
I will update this if I find any other issues.
How do you delete customer records that do not have any matching orders?
Remember that one.