Related Content
Connecting To A Non Standard MySQL Socket In PHP
Connecting to a MySQL database in PHP is usually not a difficult thing to do, in fact it is one of the first things that many tutorials will go though. However, there are certain curcumstances that require more information than the standard host, password and username details.
Count Number Of Characters In A String With MySQL
Today I needed to grab some data from a table where there was more than one occurrence of a string within another string. Basically, I needed to find all URL's from a table that were more than 3 levels deep (i.e. with 3 slashes), but realised there wasn't a function to do this in MySQL.
MySQL Order Table By Character Length
As part of debugging a bit of code I needed to know the longest possible field lengths that a record contains. You might need to know this if you are performing a database migration. The following query returns a field, along with the length of the string, and orders the results by the number of characters in that string.
Backup MySQL Database PHP Script
There are quite a few scripts available on the Internet that allow you to dump data from a database into a format that can be used to replicate that database structure elsewhere. The following function is my take on this commonly occurring script.
Starting And Stopping MySQL Using Windows .bat Files
I use my PC for a lot of different things, and I don't necessarily need to have MySQL server running all the time, especially when I want to play a game. So I wondered if there was a simple way in which I could start and stop the server using a simple .bat file.
Convert A String To A Date Value In MySQL
There are numerous ways to print out dates and times, and many hours of programming are spent in converting dates from one format to another.
Comments
LIKE in mysql is always case insensitive but for non ascii characters you must use the right charset and collation on your tables.
Test it with "SELECT 'foobar' LIKE 'FOO%'"
Submitted by Blar on Thu, 09/08/2011 - 14:23
PermalinkDepending on which character set you used to create the db, like can be case insensitive.
Submitted by Marc Johnen on Fri, 04/13/2012 - 17:05
PermalinkAdd new comment